【发布时间】:2018-10-08 22:50:59
【问题描述】:
我在我的应用程序中使用 LDAP 身份验证。 我使用这个代码:
@Override
public void configure(AuthenticationManagerBuilder auth) throws Exception {
String domain = customProperties.getAdDomain();
String url = customProperties.getAdUrl();
ActiveDirectoryLdapAuthenticationProvider provider = new ActiveDirectoryLdapAuthenticationProvider(domain,url);
provider.setConvertSubErrorCodesToExceptions(true);
provider.setUseAuthenticationRequestCredentials(true);
provider.setUserDetailsContextMapper(userDetailsContextMapper());
auth.authenticationProvider(provider);
auth.userDetailsService(new MyUserDetailsService());
}
使用空密码进行身份验证。我知道我需要插入一个空密码检查,因为在这种情况下并非所有 LDAP 服务器都返回错误。如何以及在哪里插入空白密码支票更好?
【问题讨论】:
标签: java spring spring-security ldap