Solved

validate NT Logon name using ASP and XP

Posted on 2004-04-16
5
414 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 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

Get Actionable Data from Your Monitoring Solution

Your communication platform is only as good as the relevance of the information you send. Ensure your alerts get to the right people every time with actionable responses. Create escalation rules that ensure everyone follows the process and nothing is left to chance.

Question has a verified solution.

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

An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
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.

691 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