iNET Interactive - Online Advertising Agency
          
   Home    Authors    About    Login    Contact Us
   Search:   
Advanced Search     
  Articles

  ASP (26)
  ASP.NET (19)
  C and C++ (4)
  CFML (2)
  CGI and Perl (16)
  Flash (2)
  Java (7)
  JavaScript (28)
  PHP (92)
  MySQL (13)
  MSSQL (3)
  HTML (35)
  SEO (9)
  Visual Basic (12)
  CSS (13)
  SSI (5)
  XML (12)
  C# (14)

  Developer News

July 3, 2008
Poll: Which Web editor do you use?
About
 
July 3, 2008
Book Review: Head First JavaScript
WebReference.com
 
July 3, 2008
10 Things You Can Do With a Wiki
About
 
July 2, 2008
Web Host Reviews - 10 New Reviews
About
 
July 2, 2008
14 Reasons You Should Join a Social Network
About
 
July 1, 2008
Mark Boulton's Freelance Design Secrets
SitePoint
 
Courtesy of moreover.com
 
Want to receive new articles via e-mail? Click here!
/Home /ASP

Querying the Windows Logged In User Using ASP 

  Views:    8112
  Votes:    7
by Sean Pearson 12/10/03 Rating: 

Synopsis:

For those of you creating intranet applications it is easier to integrate with Windows authentication. This is Part One, of how to enable your intranet applications to authenticate with Windows Active Directory.
Pages: 
The Article

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

Pages: 



 
  Sponsors