gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 00:38:25 26 4
gpt4 key购买 nike

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

我知道“52e”代码是用户名有效但密码无效的情况。我在 apache studio 中使用相同的用户名和密码,我能够成功建立与 LDAP 的连接。

这是我的java代码

    String userName = "*******";
String password = "********";
String base ="DC=PSLTESTDOMAIN,DC=LOCAL";
String dn = "cn=" + userName + "," + base;
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://******");
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, dn);
env.put(Context.SECURITY_CREDENTIALS, password);
LDAPAuthenticationService ldap = new LDAPAuthenticationService();
// LdapContext ctx;
DirContext ctx = null;
try {
ctx = new InitialDirContext(env);

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

我不知道到底是什么导致了这个错误。

最佳答案

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

你可能需要类似的东西

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

关于authentication - LDAP:错误代码 49 - 80090308:LdapErr:DSID-0C0903A9,注释:AcceptSecurityContext 错误,数据 52e,v1db1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31411665/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com