.NET & C#を使用してNetIQ eDirectoryに接続する必要があります。アプリケーションの資格情報を使用して接続を開く必要があります。接続が開かれたら、私は、S.DS.AccountManagementと同様の方法を使用して、アプリケーションの資格情報の権限でユーザーの資格情報を検証する必要があります。アプリケーションの資格情報を使用してeDirectoryに接続します。次に、ユーザーを認証します
using (var context = new PrincipalContext(ContextType.Domain, path, appUserDn, appPassword))
{
//Username and password for authentication.
var valid = context.ValidateCredentials(userDn, password);
}
私はNovell.Directory.Ldap、S.DS.DirectoryEntry、& S.DS.AccountManagementを試してみました。最後のものはADを必要とし、適用されません。 Novell.Directory.Ldapを使用して
テスト
... using (var cn = new LdapConnection())
{
cn.Connect(server, int.Parse(port));
cn.Bind(appUserDn, appPassword); //throws exception if invalid credentials..
var passwordAttr = new LdapAttribute("userPassword", password);
cn.Compare(userDn, passwordAttr); // Only compares password, so no locked account check, etc.
}
私の現在のプロトタイプはS.DS.Protocolsを使用しています。
var networkCredential = new NetworkCredential(
appUserDn,
appPassword);
using (proto.LdapConnection cn = new proto.LdapConnection(new proto.LdapDirectoryIdentifier(server, int.Parse(port)), networkCredential, proto.AuthType.Basic))
{
cn.Bind();
/// Next validate user credentials..
}
私はNetworkCrentialsを再割り当てし、個々のユーザー名&パスワードを使用して再バインド以外のユーザーの資格情報を検証する方法を見つけることができません。私はどのように進めるべきですか?