I am new to Spring boot and Spring Security. Is there any issues with my current Spring boot version 1.3.7.RELEASE? How can I fixed this problem?
My SecurityC
java.lang.IllegalArgumentException: Cannot pass a null GrantedAuthority collection
The error is obvious, you should assign at least one role to your first user. For example, you can assign him a USER
role too:
@Configuration
@EnableGlobalMethodSecurity(securedEnabled = true)
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
public void configureAuth(AuthenticationManagerBuilder auth) throws Exception {
auth
.inMemoryAuthentication()
.withUser("thomas")
.password("password")
.roles("USER")
.and()
.withUser("joe")
.password("password")
.roles("USER");
}
}