Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Help -- Authenticating user against LDAP using ASP
I have been strugling with this one for few ws now. I hope to get
some help here.

Following code works fine, except that I have to hard-code the user's
fullpath (2nd parameter of the OpenDSObject() method).

Here is the code:

--------------------------

sub login5(uid, password)

Dim userName, ldapserver, dso, lobjUser, ldap_path

ldap_path = "LDAP://servername/dc=domain,dc=com"
userName =
" uid=#userid#,ou=int7,ou=internal,ou=peop
le,c=us,cn=users,dc=domain,dc=com"
userName = Replace(userName, "#userid#", uid)

' Connect to the LDAP Directory
Set dso = GetObject("LDAP:")

'Validate the User Name and Password
Set lobjUser = dso.OpenDSObject(ldap_path, userName, password, 0)


If Err.number <> 0 Then
Response.Write "AUTHENTICATION FAILURE!"
Set lobjUser = nothing
Set dso = nothing
Else
Response.Write "SUCCESS!"
end if
end sub

-------------------------

For this this work, I need to know exact path of the user

i.e. userName =
" uid=#userid#,ou=int7,ou=internal,ou=peop
le,c=us,cn=users,dc=domain,dc=com"

Is there anyway to do something like this or is there a better
approach?  I just want to pass in a userid and password and let it
search the whole directory for the given uid to authenticate.

userName = " uid=#userid#,ou=*,ou=*,ou=*,c=*,cn=*,dc=
domain,dc=com"
Thanks


Report this thread to moderator Post Follow-up to this message
Old Post
DejaUser
12-23-04 08:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

ASP archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 08:14 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.