Active Directory'de bir kullanıcının kimliğini doğrulamak için aşağıdaki kodu kullanıyorum, ancak parola açık bir metin gönderiyor. Şifremi nasıl alabilir ve sonra Active Directory'ye gönderebilirim?Aktif dizin kimlik doğrulaması
DirectoryEntry entry = new DirectoryEntry(path, username, pwd);
try
{
//Bind to the native AdsObject to force authentication.
object obj = entry.NativeObject;
DirectorySearcher search = new DirectorySearcher(entry);
search.Filter = "(SAMAccountName=" + username + ")";
search.PropertiesToLoad.Add("cn");
SearchResult result = search.FindOne();
if (null == result)
{
return false;
}
//Update the new path to the user in the directory.
_path = result.Path;
_filterAttribute = (string)result.Properties["cn"][0];
}
catch (Exception ex)
{
throw new Exception("Error authenticating user. " + ex.Message);
}
return true;
Bu iyi bir soru. Merak etme, Hangi AuthenticationType kullanıyorsunuz? – Pandincus
Kimlik Doğrulama Türü'nün anlamı nedir, System.DirectoryServices kullanıyorum; name space ve Authenticating için belirtilen kod –