Here is the code in which the authorization.
@Autowired public void configureSecurity(final AuthenticationManagerBuilder auth) throws Exception { auth.jdbcAuthentication().dataSource(dataSource) .usersByUsernameQuery("select user_name, user_password_hash, user_id from rs_user where user_name=?") .authoritiesByUsernameQuery("select user_name, user_is_administrator, user_id from rs_user where user_name=?"); } /** * Configure http. * @param http of HttpSecurity type * @throws Exception of authentication exception */ @Override public void configure(final HttpSecurity http) throws Exception { http.formLogin().and().authorizeRequests().anyRequest().authenticated() .and().formLogin().successHandler(savedRequest()) .usernameParameter("login") .passwordParameter("password") .and().csrf().disable().rememberMe().tokenRepository(persistenceTokenReposetory()) .tokenValiditySeconds(400000000); }
What causes this error? Is there a problem in csrf, or did I form a wrong query? Login and password pull from PostgreSQL database