Help -- Authenticating user against LDAP using ASP
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > IIS server support > IIS ASP > Help -- Authenticating user against LDAP using ASP




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Help -- Authenticating user against LDAP using ASP  
DejaUser


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-23-04 10:59 PM

I have been strugling with this one for few weeks 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=campbells,dc=co
m"

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=campbells,dc=co
m")

Is there anyway to do something like:

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






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 01:14 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register