LDAP:错误代码 49 - 80090308:LdapErr:DSID-0C0903A9,注释:AcceptSecurityContext 错误,数据 52e,v1db1 [英] LDAP: error code 49 - 80090308: LdapErr: DSID-0C0903A9, comment: AcceptSecurityContext error, data 52e, v1db1

查看:233
本文介绍了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 的连接.

I know "52e" code is when username is valid, but password is invalid. I am using the same user name and password in my apache studio, I was able to establish the connection succesfully to 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);

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

I do not know what exactly is causing this error.

推荐答案

data 52e - 当用户名是时返回有效,但密码/凭据无效.

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

你可能需要类似的东西

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

这篇关于LDAP:错误代码 49 - 80090308:LdapErr:DSID-0C0903A9,注释:AcceptSecurityContext 错误,数据 52e,v1db1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆