【问题标题】:AcceptSecurityContext error when using ldap使用 ldap 时出现 AcceptSecurityContext 错误
【发布时间】:2019-12-11 14:14:12
【问题描述】:

我有问题。这是我使用 ldap 进行身份验证的代码

在春天,但它有错误告诉我 AcceptSecurityContext。

javax.naming.AuthenticationException:[LDAP:错误代码 49 - 80090308:LdapErr:DSID-0C090400,注释:AcceptSecurityContext 错误,数据 52e,v1db1]

请帮帮我

@GetMapping("/login/{userName}/{password}")
        public Map<String, Boolean> login(@PathVariable(value = "userName") String username,@PathVariable(value = "password") String password) throws Exception {
            LdapContextSource contextSource = new LdapContextSource();
            contextSource.setUrl(url);
            contextSource.setUserDn("userPrincipalName=arpa@msv.net");
            contextSource.setPassword("masterone4408$$)*");
            contextSource.afterPropertiesSet();
            LdapTemplate ldapTemplate=new LdapTemplate(contextSource);
            AndFilter filter = new AndFilter();
            System.out.println(username+"////"+password);
            filter.and(new EqualsFilter("cn", username));
            ldapTemplate.afterPropertiesSet();
            Map<String, Boolean> response = new HashMap<>();
            response.put("deleted", ldapTemplate.authenticate(DistinguishedName.EMPTY_PATH,"(&(userPrincipalName="+username+"@msv.net))", password));
            return response;
        }

【问题讨论】:

标签: java spring spring-boot spring-security ldap


【解决方案1】:

[LDAP:错误代码 49 -...数据 52e Returns when username is valid but password/credential is invalid.

-吉姆

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-03-06
    • 1970-01-01
    • 1970-01-01
    • 2015-10-03
    • 2019-10-13
    • 2014-04-02
    • 2017-11-29
    相关资源
    最近更新 更多