认证 – LDAP:错误代码49 – 80090308:LdapErr:DSID-0C0903A9,注释:AcceptSecurityContext错误,数据52e,v1db1

前端之家收集整理的这篇文章主要介绍了认证 – LDAP:错误代码49 – 80090308:LdapErr:DSID-0C0903A9,注释:AcceptSecurityContext错误,数据52e,v1db1前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

LDAP: error code 49 – 80090308: LdapErr: DSID-0C0903A9,comment: AcceptSecurityContext error,data 52e,v1db1

我知道“52e”代码用户名是有效的,但密码无效.我在我的apache工作室使用相同的用户名和密码,我能够成功地建立到LDAP的连接.

这是我的java代码

  1. String userName = "*******";
  2. String password = "********";
  3. String base ="DC=PSLTESTDOMAIN,DC=LOCAL";
  4. String dn = "cn=" + userName + "," + base;
  5. Hashtable env = new Hashtable();
  6. env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
  7. env.put(Context.PROVIDER_URL,"ldap://******");
  8. env.put(Context.SECURITY_AUTHENTICATION,"simple");
  9. env.put(Context.SECURITY_PRINCIPAL,dn);
  10. env.put(Context.SECURITY_CREDENTIALS,password);
  11. LDAPAuthenticationService ldap = new LDAPAuthenticationService();
  12. // LdapContext ctx;
  13. DirContext ctx = null;
  14. try {
  15. ctx = new InitialDirContext(env);

我的错误在这一行:ctx = new InitialDirContext(env);

我不知道究竟是什么导致这个错误.

解决方法

数据52e – Returns when username is valid but password/credential is invalid.

你可能需要类似的东西

  1. String dn = "cn=" + userName + "," + "CN=Users," + base;

猜你在找的C&C++相关文章