The Dynamic Authentication Filter
The Dynamic Authentication Filter(DAF) must be setup by Primus for it to be used and there is a one-time setup charge of $100.00. If you would like to use DAF please send an email to businesssupport@primus.ca requesting it. In the email specify if you would like to use an existing SQL database and if so please provide the table that will be used for authentication with the column for the userid and the column for the password. If you want to use a text file please specify it.
Please note that the DAF filter is not compatible with the SSL Level 1 service offered by Primus. The DAF configuration requires that Primus bind the user settings to a unique IP. As the Level 1 SSL service is a shared secure service of the hosting server it is not possible to protect directories on a client by client basis.
The DAF filter requires only two items to work, a database of users and associated passwords (this database can be a simple text file or a SQL database hosted with Primus), and a file dafauth.ini residing in the directori(es) to be protected. If using a text file to serve as the database for the DAF engine, Primus will setup the following: A new subfolder in your user directory (\username\security\), within this directory one empty text file will be created (users.txt). This file must remain in this directory and maintain the same filename for the engine to properly compare usernames and passwords submitted by your web clients.
The following is an example of the format required for this text file: (include only lines without (----)). The file can contain as many users and passwords as you like.
----Begin User File----
username:password
user1:abc123
----End User File----
If using a Primus SQL database to store username and password information used with
DAF, Primus will require some extra information.
- The Database name
- The Table containing the users and passwords
- The column names in the table that stores the users and the passwords
Once Primus has this information, any changes to the above will cause DAF not to function. If changes are needed, Primus must be informed in order to change the mappings within the DAF engine, this will insure proper functionality is maintained.
Securing Directories and Files
You may protect as many directories and files as you wish, provided that the directory to protect contains a file named dafauth.ini within it. The formatting of the file will determine what is protected within the directory and who has access. Once the DAF setup is completed for you, directories will only begin to be protected once the first dafauth.ini file is uploaded within the users directories.NOTE: WHEREVER THE DAFAUTH.INI IS PLACED WILL BE PASSWORD PROTECTED
Once the dafauth.ini is within the directory to be protected the formatting within it will determine what is protected in that directory as well as who has access.
The following are examples of how to edit the dafauth.ini
file to perform in different ways. This example will allow successfully authenticated
users from your database access to the directory and the files within and no other
users: (include only lines without (----))
----Begin dafauth.ini File----
[Directory]
Authenticated = enable
Anonymous = disable
----End dafauth.ini File----
This example allows authenticated users access to the whole directory while anonymous
browsers can only access the index.html file within the directory (include only lines
without (----))
----Begin dafauth.ini File----
[INDEX.HTML]
Anonymous = enable
[Directory]
Authenticated = enable
----End dafauth.ini File----
This example allows certain authenticated users access to the whole directory while
others can access it even if they are users within the database for DAF. (include
only lines without (----))
----Begin dafauth.ini File----
[Directory]
user1 = enable
user3 = enable
----End dafauth.ini File----
The steps to this point will enable the protected items, and when browsed to, will bring up the default DAF login form. If a custom form is to be used, Primus must be notified in order to enable it to be served to users when authentication is required. The ASP form must have the following form, entries in blue must remain:
-----Begin Sample File-----
<HTML>
<HEAD>
<TITLE>Login form</title>
<SCRIPT LANGUAGE="JavaScript1.1">
function isblank(s)
{
for(var i = 0; i < s.length; i++) {
var c = s.charAt(i);
if ((c != ' ') && (c != '\n') && (c != '\t')) return false;
}
return true;
}
function verifyTextField(e)
{
var msg;
var empty_fields = "";
var errors = "";
if (((e.type == "text") || (e.type == "textarea")) && !e.optional) {
// first check if the field is empty
if ((e.value == null) || (e.value == "") || isblank(e.value)) {
empty_fields += "\n " + e.name;
}
}
if (!empty_fields && !errors) return true;
msg = "Please enter a keyword to search.\n";
alert(msg);
return false;
}
</SCRIPT>
</HEAD>
<BODY>
<CENTER>
<TITLE>Password Protected Area</title>
<SCRIPT LANGUAGE="JavaScript1.1">
function isblank(s)
{
for(var i = 0; i < s.length; i++) {
var c = s.charAt(i);
if ((c != ' ') && (c != '\n') && (c != '\t')) return false;
}
return true;
}
function verifyTextField(e)
{
var msg;
var empty_fields = "";
var errors = "";
if (((e.type == "text") || (e.type == "textarea")) && !e.optional) {
// first check if the field is empty
if ((e.value == null) || (e.value == "") || isblank(e.value)) {
empty_fields += "\n " + e.name;
}
}
if (!empty_fields && !errors) return true;
msg = "Please enter a keyword to search.\n";
alert(msg);
return false;
}
</SCRIPT>
<H1>Password Protected Area</H1>
<FORM METHOD="POST" ACTION="dafloginscript.asp">
<TABLE BORDER=0 WIDTH="50%" >
<TR>
<TD></TD>
<TD><H3>Please Log In </H3></TD>
</TR>
<TR>
<TD WIDTH="100">User Name</TD>
<TD><INPUT type=text name="DAFLOGIN" value="" size=30 maxlength=25>
</TD>
</TR>
<TR>
<TD>Password</TD><TD>
<INPUT type=password name="DAFPASS" value="" size=30 maxlength=25>
</TR>
<TR>
<td></td>
<TD align="left"><INPUT TYPE="SUBMIT" VALUE="Login" ></TD>
</TR>
</TABLE></FORM>
</CENTER>
</body>
</HTML>
-----End Sample File-----
Again most changes from the default setup, will need to be communicated to Primus.
You will also require the dafloginscript.asp file.
DAF (Dynamic Authentication Filter) Login Script (954 Bytes)