Solved

How to login based on Active Directory Credentials

Posted on 2008-06-12
3
499 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Pass SQL to JSON. Page is in classic ASP and using Jquery 4 41
Powershell Script - Set Windows Updates 2 34
ASP Error Handler 5 22
GitHub 1 13
This article explains the steps required to use the default Photos screensaver to display branding/corporate images
A company’s centralized system that manages user data, security, and distributed resources is often a focus of criminal attention. Active Directory (AD) is no exception. In truth, it’s even more likely to be targeted due to the number of companies …
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …
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 …

696 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