Currently I got the main class:
package com.recweb.springboot;
import org.springframework.boot.SpringApplication;
im
Try this in SecurityConfig extends WebSecurityConfigurerAdapter :
@Bean
public PasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
@Override
protected void configure(final AuthenticationManagerBuilder auth) throws Exception{
auth
.inMemoryAuthentication()
.withUser("user")
.password(passwordEncoder().encode("password"))
.roles("USER")
.and()
.withUser("admin")
.password(passwordEncoder().encode("admin"))
.roles("USER", "ADMIN");
}
Work for me