gpt4 book ai didi

java - 使用 ldap 时出现 AcceptSecurityContext 错误

转载 作者:行者123 更新时间:2023-12-02 02:09:47 24 4
gpt4 key购买 nike

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

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

javax.naming.AuthenticationException: [LDAP: error code 49 - 80090308: LdapErr: DSID-0C090400, comment: AcceptSecurityContext error, data 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;
}

最佳答案

[LDAP: error code 49 -... data 52eReturns when username is valid but password/credential is invalid.


-吉姆

关于java - 使用 ldap 时出现 AcceptSecurityContext 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57335146/

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