0
ユーザーが自分のUIDとメールの両方でログインできるようにしたいですか?私の春のセキュリティ設定を使用してこれを達成する方法?春のセキュリティでメールとuidに基づいてLDAPからユーザーを認証する方法は?
@Configuration
@EnableWebSecurity
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.anyRequest().fullyAuthenticated()
.and()
.formLogin().passwordParameter("password");
}
@Configuration
protected static class AuthenticationConfiguration extends GlobalAuthenticationConfigurerAdapter {
@Autowired
LdapContextSource contextSource;
@Override
public void init(AuthenticationManagerBuilder auth) throws Exception {
auth
.ldapAuthentication()
.userDnPatterns("uid={0}")
.contextSource(contextSource);
}
}
}
userDnPatternsでは、uidと一緒に別の属性を指定できますか?または、uidによる認証が標準ですか?