2012-06-26 3 views
1
 using (LdapConnection ldap = new LdapConnection("localhost:389")) 
     { 
      //ldap.AuthType = AuthType.Basic; 
      ldap.Bind(new NetworkCredential("cn=manager,dc=wave,dc=com", "secret")); 
     } 

인증 유형과 함께 인증 유형을 기본으로 시도했습니다. 내가 System.DirectoryServices를 사용하고 왜하지만LdapConnection을 사용하여 OpenLDAP에 연결하는 중 오류가 발생했습니다.

한가지 더, 그것은 단지 Active Directory에 대한 완벽한 작동하기 때문에 나는 System.DirectoryServices를 사용할 수 있다는 것입니다 '고유 이름이 올바르지 않은 구문을 포함'한다는 오류를 제공, 그게 전부 .실험 계획안.

감사합니다.

답변

5

MSDN blog post은 문제를 밝힐 수 있습니다. 사용해보기 :

using (LdapConnection ldap = new LdapConnection("localhost:389")) 
    { 
     ldap.AuthType = AuthType.Basic; 
     ldap.SessionOptions.ProtocolVersion = 3; 
     ldap.Bind(new NetworkCredential("cn=manager,dc=wave,dc=com", "secret")); 
    } 
관련 문제