Setting up an authentication page for web respondents
Here is a list of instructions on how to set up an authentication page for web respondents.
Once the respondents enter their access code, they are redirected to a survey. If they have already started the survey, they should resume were they left off.
- An administrator login on the Web server (WebProd).
- The web server should be configured to be able to execute ASP.
- An SQL user access with read/write/database creation authorizations on the SQL Server.
- Having downloaded the attachment : .asp page
Set up the user database
Open your SQL server Management Tool (typically Microsoft SQL Server Management Studio) and create a new database. In this database, add your table containing Users (the respondents) and the associated access codes. Here, the new DB is called “Public”, and the new Table is called “Authentication”.
Attention: please create a field called “Pass”, this is going to be needed in a later step (for storing access codes).
Populate your table with some examples. We have added one row in that table . . . Mailfirstname.lastname@example.org, name=Stephen, Pass=askia123
Link the WebProd to the SQL
Now you need to connect to the WebProd server and create a link (DSN) to this newly created DB. This is done using Microsoft ODBC Data Source Administrator. Click “Add” to add a new data source.
Here, we have named it “Public” to match the name of the DB I’ve created in the SQL Server. Go through the data source wizard. You’ll need to provide the exact IP address and instance name to the SQL server to be able to reach it correctly (in our case it was ASKIA-JOHN\SQLEXPRESS). Also you need SQL credentials that are allowed to read this SQL database.
Once this is done, WebProd is able to “see” the SQL server and therefore the list of authorized respondents.
Find the public directory
Now, still on the WebProd server (hosting the web surveys) you will need to find the root directory of Windows IIS. It’s usually here:
Add the authentication portal file
Then, in the wwwroot folder, put the attached file: "auth.asp". This file is the actual connection page that the respondents are going to see before entering the survey. Once the file is in the root, it is accessible via www.yourwebprodserveraddress/auth.asp.
Configure the portal
Now for creating that “OK” button.
The respondents should enter the ID in the textbox. Once they press “OK” they are redirected to the survey with a “DoExternalPanel” link. Documentation is below:
To do that, open the auth.asp file with a text editor.
You only need to change the 5 parameters in the chapter called “Please change the parameters” to have a working authentication portal.
- G_strThisPageName needs to be set to the exact name of the .asp file. In our case, it is “Authenticate.asp”.
- G_strInternalName is the exact name of the survey you want to redirect to. In our case, it’s Test1 (it’s matching the task name on the Supervisor).
- G_strBroker is the parameter that is going to be used in the “DoExternalPanel” link. We’ve called my Broker “test”.
- G_strDSNName is the name of the DSN you have created). Ours is called “Public”. Then enter the SQL user id (UID) and password that are allowed to view the database.
- G_strTable is the name of the table in the SQL containing the list of respondents users/access codes. Ours was called “Authentication”.
Now we are ready to test our authentication portal.
We are typing in the access code of user “Stephen” that we created earlier : “askia123”.
The redirection happens.
We are then redirected to the survey called “Test1” with a DoExternalPanel link containing the parameters Broker=test and BrokerPanelID=askia123 (see in the URL).
The link has been generated by comparing what was in the textbox to the list of “Pass” in the SQL table (via a SQL query). If no match is found, an error “unknown user name” will be prompted.
You are welcome to change this SQL Query to fit your needs by adding more fields to the database and verifying user + password at the same time for example.
You can also tweak the aspect of the .asp page by changing the HTML/CSS chapters in the .asp file.