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
Solved

How to login based on Active Directory Credentials

Posted on 2008-06-12
3
498 Views
Last Modified: 2010-08-05
Hi, I would like to do a mockup of how to login to an Classic ASP page using Active Directory Credentials.  I have already connected to the AD using LDAP and was able to query all of the groups and it;s members.  however now I would like to take it a step further and actually use an HTML form that posts an action to a classic asp form action page that queries the AD to see if the user / pass is correct and then allow them to progress to the next screen if this is true....

i know this may be simple.... but my way was kinda bloated and id like an EXPERT to simplify it for me without all the excess :)  Thanks!!!!!
0
Comment
Question by:Devario Johnson
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
squillman earned 500 total points
ID: 21773830
Try something like this:

boolLoggedIn=false
strDomain = "MYDOMAIN"
strUser="user1"
strUserDomain = strDomain & "\" & strUser
strPassword="password"
ADS_SECURE_AUTHENTICATION=1 'this is a const, not a flag

Set objNameSpace= GetObject("WinNT:")    
Set objDSObject = objNameSpace.OpenDSObject("WinNT://" & strDomain, strUserDomain, strPassword, ADS_SECURE_AUTHENTICATION)
If Err.Number <> 0 Then
    boolLoggedIn = False
Else
     boolLoggedIn = True
End If
0
 
LVL 5

Author Comment

by:Devario Johnson
ID: 21775254
That is a very clean and precise code...I dont even see Ldap anywhere...thanks for your assitance!!!!!

I will try this when I get in to work tomorrow!
0
 
LVL 5

Author Closing Comment

by:Devario Johnson
ID: 31466737
Good job...the only thing missing from this example are variable declarations...but you should know that by looking at it.  just a FYI to novice programmers who may be researching this thread
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
This article describes my battle tested process for setting up delegation. I use this process anywhere that I need to setup delegation. In the article I will show how it applies to Active Directory
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

860 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