![](/img/trans.png)
[英]LDAP: error code 49 - 80090308: LdapErr: DSID-0C09044E, comment: AcceptSecurityContext error, data 52e, v2580 (first time using ldap)
[英]LDAP: error code 49 - 80090308: LdapErr: DSID-0C09042F, comment: AcceptSecurityContext error, data 52e, v2580
LDAP: error code 49 - 80090308: LdapErr: DSID-0C09042F, comment: AcceptSecurityContext error, data 52e, v2580
我知道“52e”代碼是用戶名有效,但密碼無效。 我使用相同的用戶名和密碼來驗證用戶對Active Directory及其工作正常。
這是我的java代碼:
String userName = "user_test";
String password = "*******";
String base ="DC=test,DC=local";
String dn = "cn="+ userName + "," + "CN=Users," + base;
try {
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, dn);
env.put(Context.SECURITY_CREDENTIALS, password);
env.put(Context.PROVIDER_URL, "ldap://*****.test.local:389");
System.out.println("Attempting to Connect...");
ctx = new InitialLdapContext(env, null);
System.out.println("Connection Successful.");
} catch (NamingException nex) {
System.out.println("LDAP Connection: FAILED");
nex.printStackTrace();
}
return ctx;
}
我不知道為什么會出現這個錯誤。 有人可以幫忙嗎?
如果您使用簡單的權限驗證,則應使用簡短的用戶名表單
user_test@test.local
我查了一下,在這種情況下認證工作正常。 在dn形式中,我有完全相同的錯誤
javax.naming.AuthenticationException: [LDAP: error code 49 - 80090308: LdapErr: DSID-0C0903A9, comment: AcceptSecurityContext error, data 52e, v1db1
您還可以參考早期的線程LDAP:錯誤代碼49 - 80090308:LdapErr:DSID-0C0903A9,注釋:AcceptSecurityContext錯誤,數據52e,v1db1
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.