Rajendran S

Rajendran S

  • 1.2k
  • 523
  • 128.7k

LDAP SSL connection using ASP.Net MVC web application - How to connect

May 21 2021 1:56 AM
Help me !!!! 
 System.DirectoryServices.Protocols
I try to connect the LDAP Connection with the above assembly reference but it connection it says  
 The supplied credential is invalid.
 80090308: LdapErr: DSID-0C090453, comment: AcceptSecurityContext error, data 52e, v3839
 
  1. using (LdapConnection ldapConnection = new LdapConnection(activeDirectoryServer) { Timeout = TimeSpan.FromSeconds(600) })    
  2. {    
  3.     var networkCredential = new NetworkCredential(loginCN, ldpPassowrd, activeDirectpryDomain);    
  4.     ldapConnection.SessionOptions.SecureSocketLayer = true;    
  5.     ldapConnection.Credential = networkCredential;    
  6.     ldapConnection.SessionOptions.VerifyServerCertificate = new VerifyServerCertificateCallback(ServerCallback);    
  7.     ldapConnection.SessionOptions.ProtocolVersion = 3;    
  8.     ldapConnection.AuthType = AuthType.Basic;    
  9.     ldapConnection.Bind(networkCredential);    
  10. }    
 
 
If anyone already tried with that please help me

Answers (3)