2

I've a problem, I use spring boot and there I've implemented security. In securityConfig class (below method source code) I've provided username and password parameters to be checked during login process. I need also to check if account is activated, in db I've a column 'activated' with boolean value. And how to provide my own parameter with account activated to login process ?

@Override
protected void configure(HttpSecurity http) throws Exception {
    http.authorizeRequests()
            .antMatchers("/").permitAll()
            .antMatchers("/investors/**").hasAnyRole("ADMIN")
            .antMatchers("/search**").authenticated()
            .anyRequest().fullyAuthenticated()
            .and()
            .formLogin()
            .loginPage("/login")
            .usernameParameter("username")  < - 
            .passwordParameter("password")  < -
            .permitAll()
            .and()
            .logout()

Thanks for help

Lemmy
  • 2,437
  • 1
  • 22
  • 30
joean
  • 21
  • 3

0 Answers0