Custom Authentication provider with Spring Security and Java Config

The following does what you need (CustomAuthenticationProvider is your implementation which needs to be managed by Spring)

public class WebSecurityConfig extends WebSecurityConfigurerAdapter {

    private CustomAuthenticationProvider customAuthenticationProvider;

    protected void configure(HttpSecurity http) throws Exception {
         * Do your stuff here

    protected void configure(AuthenticationManagerBuilder auth) throws Exception {

Leave a Comment