Solved

How to login based on Active Directory Credentials

Posted on 2008-06-12
3
501 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
[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
  • 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

In-place Upgrading Dirsync to Azure AD Connect
Had a business requirement to store the mobile number in an environmental variable. This is just a quick article on how this was done.
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

707 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