?
Solved

validate NT Logon name using ASP and XP

Posted on 2004-04-16
5
Medium Priority
?
415 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 1500 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.
Suggested Courses
Course of the Month8 days, 1 hour left to enroll

765 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