使用 "com.sun.jndi.ldap.LdapCtxFactory" 在 LDAP 身份验证中SECURITY_PRINCIPAL的正确格式是什么


env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://xxx.xxx.xxx.xx:xxx");
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, "CN=username");
env.put(Context.SECURITY_CREDENTIALS, pwd);
env.put(Context.REFERRAL,"follow"); 

我只需要搜索特定域中的"CN"。尝试使用上述方式和多种格式,但最终出现错误"LDAP 错误代码 49 AcceptSecurityContext 错误数据 52e v2580"。拜托,有人帮我解决这个问题。

不确定您在介绍您的问题时缺少什么。

LDAP 错误代码 49 接受安全上下文错误数据 52e 当用户名有效但密码/凭据无效时返回。

我们有几个针对 Microsoft Active Directory 的 JNDI 示例。

您应该告诉我们您尝试过的内容并显示日志或结果并阅读: https://stackoverflow.com/help/how-to-ask

相关内容

最新更新