Search code examples
c#sslssl-certificateadamadlds

ADLDS SSL certificate issue authentication failing


I'm having some issue with ADLDS authentication.

Every time I try to login I get the following error message on the machine where ADLDS is installed.

No suitable default server credential exists on this system. This will prevent server applications that expect to make use of the system default credentials from accepting SSL connections. An example of such an application is the directory server. Applications that manage their own credentials, such as the internet information server, are not affected by this.

I had installed few dev certs to allow SSL and I had some issue. So I removed all the certs I installed and now I get the following error. I reverted my code back to not use secure connection.

    protected ContextOptions _contextOptions = ContextOptions.Negotiate;
    protected PrincipalContext getPrincipal()
    {
        return new PrincipalContext(ContextType.ApplicationDirectory, "myserver.public:11389", "CN=mycontainer,DC=t,DC=public", _contextOptions);
    }

    //Authenticate users against AD LDS 
    public bool Authenticate(string username, string password)
    {
        bool isAuthenticated = false;
        using (PrincipalContext pCtx = getPrincipal())
        {
            isAuthenticated = pCtx.ValidateCredentials(username, password);
        }
        return isAuthenticated;
    }

But for some reason it still trying to do secure connection. Please note that I have some other code such as looking up user by GUIDID and that works without any issues. Anything that has to do with password is not working.

Any suggestions on how to fix this?


Solution

  • Unfortunately, most of the times Microsoft's error messages are misleading. We were able to to resolve this issue by installing appropriate certificates on the server.