error connecting to Active Directory via LDAP from ASP/VBScript pg
- From: spam12@xxxxxxxxxxx
- Date: 1 Nov 2005 15:01:08 -0800
I'm rather new to the world of VBScript/ASP. I'm a *nix-head and have
been programming in PHP for years. I'm rather frustrated because I do
not know how to go about trouble-shooting an error I'm receiving in a
script I'm trying to implement to authenticate a user against AD.
The script is as follows (found it in these usenet groups):
<%@ Language=VBScript %>
<%
Dim username, password, ldapserver, ldap_path
' Construct the FQDN
ldap_path = "LDAP://cn=##,DC=ourcollege,DC=edu"
' Get the ldap server name into local variable by replacing the special
' charcter with the username
ldapserver = Replace(ldap_path,"##",Request.Form("username"))
Response.Write("<b>username:</b> " & Request.Form("username") & "<br
/>")
Response.Write("<b>ldapserver:</b> " & ldapserver & "<br />")
' Parse the username from the ldap path
username = Mid(ldapserver, InStr(8, ldapserver, "/") + 1)
Response.Write("<b>username:</b> " & username & "<br />")
' Get the password
Password = Request.Form("Password")
' Connect to the LDAP Directory
Set dso = GetObject("LDAP:")
' Validate the User Name and Password
Set objUser = dso.OpenDSObject(ldapserver, username, password, 0)
'Response.Write("<b>lobjuser.class:</b> " & lobjUser.class & "<br />")
'Response.Write("<b>err.description:</b> " & err.description & "<br
/>")
' Exit with error - Incorrect username & password - return to login.asp
page
'If Err.number<>0 Then
' Response.Write "<b>Result:</b> Authentication Failure.<br />"
' Set lobjUser = nothing
' Set dso = nothing
'Else
' Response.Write "<b>Result:</b> Success.<br />"
'End If
'To get information from the LDAP directory you need to know the
"attributes"
'available and then you can reference them. Ex:
'strUserName = lobjUser.Get("cn")>
%>
The above code generates the very unhelpful error:
error '8007054b'
/ldap_auth_02.asp, line 29
Is there a system log which will give me more information on the error
which occured? Is there something I can response.write to my browser
which might give me a more useful error message?
I recently put together a PHP script to connect to AD via LDAP. I had
to bind to AD using a username (RDN?) and password before I could
perform a query. (I apologize if I'm not using the appropriate
terminology.) I then passed AD our Base DN, filter, and search terms.
I can't find any documentation on this. My ultimate goal is to
authenticate a user with their AD credentials.
.
- Follow-Ups:
- Re: error connecting to Active Directory via LDAP from ASP/VBScript pg
- From: Brian Staff
- Re: error connecting to Active Directory via LDAP from ASP/VBScript pg
- Prev by Date: SCSI Adapter Port Number
- Next by Date: Re: error connecting to Active Directory via LDAP from ASP/VBScript pg
- Previous by thread: SCSI Adapter Port Number
- Next by thread: Re: error connecting to Active Directory via LDAP from ASP/VBScript pg
- Index(es):
Relevant Pages
|
Loading