Use System.DirectoryServices from classic asp

Discussion in 'ASP .Net Security' started by jrsrls, Mar 13, 2006.

  1. jrsrls

    jrsrls Guest

    I need to authenticate against AD from a classic asp site. I've
    created a C# project that runs as an exe and successfully authenticates
    using DirectorySerivces with the entered credentials. When I add the
    code to a class (.dll) and register the object with regasm and gacutil
    the asp page successfully calls the object but I cannot bind to AD.

    I get the following message. "The specified domain either does not
    exist or could not be contacted"

    I think it is because of the permissions the object is running under
    but I do not know how to get around it. I can't change the settings on
    the web server which is set to anonymous access.

    Any thoughts or suggestions?
    jrsrls, Mar 13, 2006
    1. Advertisements

  2. This is probably because the identity that is running the code is not a
    domain account and your code is using serverless binding (no server or
    domain info in the binding string; just a DN).

    You might try adding the DNS domain name of the domain to your ADsPath:

    instead of LDAP://RootDSE

    Note that ASP has ADSI and the OpenDsObject method. You could have just
    called that instead of going through the trouble of doing a COM callable
    wrapper. S.DS just calls ADSI anyway!

    Joe K.
    Joe Kaplan \(MVP - ADSI\), Mar 13, 2006
    1. Advertisements

  3. jrsrls

    jrsrls Guest


    Thanks for the response. That was the problem. I added the DNS and all
    is well.
    jrsrls, Mar 13, 2006
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.