我可以使用下面的代碼來驗證對Active Directory用戶和正常工作:認證
bool authentic = false;
PrincipalContext pc = new PrincipalContext(ContextType.Domain, domain);
// validate the credentials against domain
authentic = pc.ValidateCredentials(userName, password);
但是用戶名和密碼被髮送到網絡中平原文本。我被告知要使用ContextOptions.SecureSocketLayer
與ValidateCredentials
但它拋出異常
服務器無法處理目錄請求。
任何人都可以請幫助我,以便我可以以安全的方式與LDAP服務器進行身份驗證。
感謝