In ASP, how to connect to LDAP by not using complete names?

Discussion in 'ASP General' started by Fie Fie Niles, Sep 9, 2004.

  1. In an ASP page, when I use the OpenDSObject to connect to LDAP, it works
    when I use the complete user name.
    For example:
    If I use "John A Smith" or "Paul B Allen" and set strUserName = "cn=John A
    Smith,ou=medel,o=uniba", the user is authenticated succesfully.

    If I use "JSmith" or "PAllen" and set strUserName =
    "cn=JSmith,ou=medel,o=uniba", I got an error '8007052e'.

    Is this right ? Is there a way to NOT use the complete name ?
    Thank you very much.

    This is my ASP page:

    strADsPath = "LDAP://LDAP"
    if (not strADsPath= "") then
    ' bind to the ADSI object and authenticate Username and password
    set oADsNamespace = GetObject("LDAP:")
    Set oADsObject = oADsNamespace.OpenDSObject(strADsPath, strUserName,
    strPassword, 0)
    if not (Err.number = 0) then
    Response.Write "Failed to bind to object " & strADsPath
    Response.write err.number & ":" & err.description
    Else
    Response.Write "USER AUTHENTICATED!"
    Response.Write "Currently viewing object at " & oADsObject.ADsPath
    Response.Write "UserName is " & oADsObject.Name
    end if
    end if
     
    Fie Fie Niles, Sep 9, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ian Harding

    Can't connect JNDI using LDAP/SSL

    Ian Harding, Sep 1, 2005, in forum: Java
    Replies:
    0
    Views:
    1,091
    Ian Harding
    Sep 1, 2005
  2. Replies:
    3
    Views:
    40,452
    Roedy Green
    Nov 16, 2005
  3. Replies:
    1
    Views:
    543
    Raymond DeCampo
    Feb 21, 2006
  4. Jason Wold

    using LDAP Controls in ruby-ldap

    Jason Wold, Nov 4, 2004, in forum: Ruby
    Replies:
    5
    Views:
    268
  5. kang cao
    Replies:
    3
    Views:
    282
    Phillip Gawlowski
    Apr 14, 2011
Loading...

Share This Page