저는 LDAP를 처음 사용하고 .Net을 사용하여 LDAP 서버에 연결하여 사용자 자격 증명의 유효성을 검사하려고했습니다. 다음 코드는 오류를 반환합니다.LDAP를 사용하여 자격 증명의 유효성을 검사 할 수 없습니다.
The LDAP server is unavailable
그러나 유효성 검사는 Java 코드에서 올바르게 작동합니다. 친절하게 내가 잘못한 곳을 알려주십시오. 모든
using (PrincipalContext pc = new PrincipalContext(ContextType.Domain, "LDAP://192.168.65.201:389/DC=be,DC=ndl,DC=CompanyName,DC=com"))
{
bool a= pc.ValidateCredentials("[email protected]","password");
}
는 LDAP 서버에 액세스 할 수있는 코드 변경 : 하여 DirectoryEntry 항목 = 새로운하여 DirectoryEntry (ldapPath, txtUsername.Text.ToString을()() txtPassword.Text.ToString를() 트림 트림()..) 개체 obj = entry.NativeObject; DirectorySearcher search = 새 DirectorySearcher (항목); – psobhan