LDAP path

Discussion in 'ASP .Net Security' started by sck10, Apr 15, 2005.

  1. sck10

    sck10 Guest

    Hello,

    I was given some code that was done in ColdFusion, and I am trying to figure
    out how to map the LDAP path. Any help would be appreciated.

    This is what I got from the Microsoft web site
    // Path to you LDAP directory server.
    string adPath = "LDAP://yourCompanyName.com/DC=yourCompanyName,DC=com";
    LdapAuthentication adAuth = new LdapAuthentication(adPath);

    This is the code snippet that I got fro ColdFusion
    -------------------------------------------------
    <cfldap action="QUERY"
    name="empquery_login"
    attributes="employeenumber,roomnumber,sname"
    start="ou=people, o=lucent.com"
    filter="(employeenumber=#ssno#)"
    scope="onelevel"
    server="ldap-useast.train.com"
    port="389">

    --
    Thanks in advance,

    sck10
    sck10, Apr 15, 2005
    #1
    1. Advertising

  2. Hi,

    Currently I am looking for somebody who could help you on it. We will reply
    here with more information as soon as possible.
    If you have any more concerns on it, please feel free to post here.


    Thanks for your understanding!

    Best regards,

    Peter Huang
    Microsoft Online Partner Support

    Get Secure! - www.microsoft.com/security
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Peter Huang [MSFT], Apr 16, 2005
    #2
    1. Advertising

  3. I'm not sure what "LdapAuthentication" is here, but if that is an MS sample,
    there is a good chance that it is AD-specific and should not be used.

    What are you trying to do here, authenticate a user to an LDAP directory or
    just look up some attribute values from their user object in the LDAP store?

    Given that the example below is a simple search, I'll assume the latter. In
    that case, you would want to try to use the DirectorySearcher with something
    like this:

    //air code, may not compile
    DirectoryEntry root = new
    DirectoryEntry("LDAP://ldap-useast.train.com/ou=people, o=lucent.com", "",
    "", AuthenticationTypes.None);
    DirectorySearcher searcher = new DirectorySearcher(root);
    searcher.SearchScope = SearchScope.OneLevel;
    searcher.PropertiesToLoad.AddRange(new string[] {"employeenumber",
    "roomnumber", "sname"});
    searcher.Filter = String.Format("(employeenumber={0})", empNum); //you
    provide that parameter...
    SearchResult result = searcher.FindOne();
    //then retrieve the values from the result.Properties collection

    The trick here will be in providing the correct credentials and
    authentication types to work with your directory. In the example above, I
    provided a null user and password, but that might not be right. Using
    AuthenticationTypes.Anonymous may also be correct.

    The other thing to watch out for would be schema mapping issues. ADSI/S.DS
    is notorious for struggling to parse the schema of third-party LDAP
    directories, so if you get weird "cannot convert datatype" errors, that is
    the problem. In that case, you might not be able to get this to work with
    S.DS and might need to wait for .NET 2.0 and
    System.DirectoryServices.Protocols.

    HTH,

    Joe K.

    "sck10" <> wrote in message
    news:...
    > Hello,
    >
    > I was given some code that was done in ColdFusion, and I am trying to
    > figure
    > out how to map the LDAP path. Any help would be appreciated.
    >
    > This is what I got from the Microsoft web site
    > // Path to you LDAP directory server.
    > string adPath = "LDAP://yourCompanyName.com/DC=yourCompanyName,DC=com";
    > LdapAuthentication adAuth = new LdapAuthentication(adPath);
    >
    > This is the code snippet that I got fro ColdFusion
    > -------------------------------------------------
    > <cfldap action="QUERY"
    > name="empquery_login"
    > attributes="employeenumber,roomnumber,sname"
    > start="ou=people, o=lucent.com"
    > filter="(employeenumber=#ssno#)"
    > scope="onelevel"
    > server="ldap-useast.train.com"
    > port="389">
    >
    > --
    > Thanks in advance,
    >
    > sck10
    >
    >
    Joe Kaplan \(MVP - ADSI\), Apr 16, 2005
    #3
    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. Replies:
    1
    Views:
    528
    Raymond DeCampo
    Feb 21, 2006
  2. rcmn
    Replies:
    1
    Views:
    333
    =?ISO-8859-1?Q?Michael_Str=F6der?=
    Nov 6, 2006
  3. Jason Wold

    using LDAP Controls in ruby-ldap

    Jason Wold, Nov 4, 2004, in forum: Ruby
    Replies:
    5
    Views:
    241
  4. Ian Macdonald
    Replies:
    0
    Views:
    216
    Ian Macdonald
    Mar 15, 2005
  5. James Hughes
    Replies:
    4
    Views:
    326
    James Hughes
    Dec 13, 2005
Loading...

Share This Page