Quantcast
Channel: Directory Services forum
Viewing all articles
Browse latest Browse all 31638

LADP with SSL authentication failed "The supplied credential is invalid", custom OU and email as username

$
0
0

Hi team,

I have custom OU in which users are created and using email as username. Following code is throwing invalid credentials error.

Here are the queries.

1) how to fix this error.

2) if we need to configure it to use custom OU name and email as username.

protected void btnLoginEntity_Click(object sender, EventArgs e)
        {
            string server = "AAADVSD0S2-EED.eep.eed.ext";
            int port = 636;
            try
            {
                string currentURL = System.Web.HttpContext.Current.Request.Path.ToLower();

                string userName = txtUserNameEntity.Text.Trim();
                string password = txtPasswordEntity.Text.Trim();

                LdapDirectoryIdentifier ldi = new LdapDirectoryIdentifier(server, port);
                LdapConnection connection = new LdapConnection(ldi);

                connection.SessionOptions.SecureSocketLayer = true;

                connection.SessionOptions.VerifyServerCertificate = new VerifyServerCertificateCallback(ServerCallback);
                connection.Credential = new NetworkCredential(userName, password);

                connection.AuthType = AuthType.Ntlm;
                connection.Bind();

                //do something
            }
            catch (Exception ex)
            {
                throw ex;
                //ask relogin
            }
        }

LADP invalid creds error.


Viewing all articles
Browse latest Browse all 31638

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>