Nowadays you have a password or pin number to everything. We, as admins, are asking our users to have complicated passwords established for logging in to the network. Most of the time I find a sticky note or some piece of paper underneath their keyboard with a list of all their usernames and passwords. It defeats the purpose to have a complicated password if the password is written in clear text. From a user (and administrator) standpoint, it is easier to have one login and password to access applications and the network. With that in mind, this is the first part of how to integrate your intranet applications with Active Directory.
Both PHP and ASP can pull the username of the person who is logged into the machine. However, I have found that ASP makes it easier and does a better job. In order to pull the username you must ensure that the site for which the application is setup has Integrated Windows Authentication checked under Directory Security tab. To enable this, right click on the site name within Internet Services Manager and select Properties. Click on the Directory Security tab. Under Anonymous Access and Authentication Control, click on the Edit button. At the bottom of the window select the checkbox next to Integrated Windows Authentication.
Once IIS is configured properly, you can now write a small script to pull the username of the person who is <BR> accessing the intranet application. Below is a sample script:
<%
If Request("REMOTE_USER") = "" Then
Response.Status = "401 Unauthorized"
elseif request("REMOTE_USER") <> "" then
response.write Request.Servervariables("REMOTE_USER")
username = Request.Servervariables("REMOTE_USER")
end if
%> |
The above script will write out something similar to this: DOMAIN\username