Need Help!
Loop with stackowerflow only while unsuccessful authorization via AD
1 authenticate: 201, ProviderManager (org.springframework.security.authentication) [5]
@Bean
public ActiveDirectoryLdapAuthenticationProvider getLdapAuthenticationProvider() {
BindAuthenticator bindAuthenticator = new BindAuthenticator(contextSource());
bindAuthenticator.setUserDnPatterns(new String[]{userDNPattern});
ActiveDirectoryLdapAuthenticationProvider authenticationProvider =
new ActiveDirectoryLdapAuthenticationProvider(null, ldapUrl, ldapPartitionSuffix);
authenticationProvider.setConvertSubErrorCodesToExceptions(true);
authenticationProvider.setUseAuthenticationRequestCredentials(true);
if (userDNPattern != null && userDNPattern.trim().length() > 0) {
authenticationProvider.setSearchFilter(userDNPattern);
}
return authenticationProvider;
}
@Bean
public AuthenticationManager authManager(HttpSecurity http) throws Exception {
AuthenticationManagerBuilder authBuilder = http.getSharedObject(AuthenticationManagerBuilder.class);
authBuilder.authenticationProvider(getLdapAuthenticationProvider());
return authBuilder.build();
}