WebSecurityConfig in java spring app doesnt work

hey guys. can smb help me out? i have java spring app runing on my server dev2. on the server i also have nginx basic auth and proxy configured. now when i do the request to http://dev2.mysite.lt/bgw/perlas i get asked for my nginx basic auth credentials. i enter them, and later im prompted with another login page thats comming from my app. my WebSecurityConfig looks like this:
@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {

    @Autowired
    private MyUserDetailsService userDetailsService;

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http
                .authorizeRequests()
                .antMatchers("/perlas").permitAll()

                .anyRequest().authenticated()
                .and().formLogin().loginPage("/login").permitAll()
                .and().logout().permitAll()
                .and().csrf().disable();
    }
    @Override
    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
        auth.userDetailsService(userDetailsService);
        auth.authenticationProvider(authProvider());
    }
    @Bean
    public PasswordEncoder passwordEncoder() {
        return new CryptEncoder();
    }
    @Bean
    public DaoAuthenticationProvider authProvider() {
        DaoAuthenticationProvider authProvider = new DaoAuthenticationProvider();
        authProvider.setUserDetailsService(userDetailsService);
        authProvider.setPasswordEncoder(passwordEncoder());
        return authProvider;
    }
}

can smb help me out? thx
Was this page helpful?