Solved

validate NT Logon name using ASP and XP

Posted on 2004-04-16
5
409 Views
Last Modified: 2012-06-27
I am using XP and have created an ASP Login page on my site.  At present the user has to type in a user name and password to access the site.

What I would like to do is automatically check the users NT logon name when the page opens.  If the user exists(ie, they are an NT user and they have a relevant row in the associated lookup table within my database), then allow them access.

I have searched various other sites including this one and cannot find the answer.

Any help appreciated
0
Comment
Question by:fx124
5 Comments
 
LVL 7

Expert Comment

by:ramesh12
ID: 10843505
0
 

Author Comment

by:fx124
ID: 10843800
thanks for that ramesh12.

Unfortunately it is not quite what I am looking for.  Maybe my description wasn't clear enough.  I know I can hard-code in the Userdomain and username but that is what I am trying to get away from.  I want the "Application" to pick these up automatically from the machine i am logged in to

Thanks
0
 
LVL 7

Expert Comment

by:TheKenman
ID: 10843973
For the domain, you can use this ADSI example:

     ' Get Domain name from RootDSE object.
     Set objRootDSE = GetObject("LDAP://RootDSE")
     strDomain = objRootDSE.Get("DefaultNamingContext")
     Set objRootDSE = Nothing

For the user, do this:

     strUser = Request.ServerVariables("LOGON_NAME")
     strPW = Request.ServerVariables("AUTH_PASSWORD")

But I think that only works once you've logged in...
0
 

Author Comment

by:fx124
ID: 10844215
Thanks TheKenman

I shall have to get back to you on Monday with the result.  Fingers crossed, eh!
0
 
LVL 5

Accepted Solution

by:
MMeijer earned 500 total points
ID: 10846705
By default the Request.ServerVariables("LOGON_NAME") = empty, unless "allow anonymous access" is off (IIS manager>permissions).

Normally this would result in a authentication box when a user is trying to access the site.
Unless this is about an intranet and users use IE then IE will try to automatically authenticate by sending the current user logon info, for more info on this open IE>Tools>Internet Options>Security.

Once you get the Request.ServerVariables("LOGON_NAME") it exists of domain/username, now you can test the info with ADSI.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
input text box not behaving properly when debug points are set 4 54
Problem to ToolkitScriptManager 2 51
Using MS Code on my Mac 6 65
Problem to go to Web page 2 97
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now