I have a SpringBoot 2.0.1.RELEASE mvc application, Here is my config file
@Configuration
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
private Environment env;
@Override
protected void configure(HttpSecurity http) throws Exception {
final List<String> activeProfiles = Arrays.asList(env.getActiveProfiles());
if (activeProfiles.contains("dev")) {
http.csrf().disable();
http.headers().frameOptions().disable();
}
http
.authorizeRequests()
.antMatchers(publicMatchers()).permitAll()
.and()
.formLogin().loginPage("/login").defaultSuccessUrl("/elcordelaciutat/config")
.failureUrl("/login?error").permitAll()
.and()
.logout().permitAll();
}
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
PasswordEncoder encoder = PasswordEncoderFactories.createDelegatingPasswordEncoder();
UserDetails userDetails = User.withUsername("elcor")
.password(encoder.encode("elcor"))
.roles("ADMIN")
.build();
auth.inMemoryAuthentication().withUser(userDetails);
}
private String[] publicMatchers() {
/** Public URLs. */
final String[] PUBLIC_MATCHERS = {
"/webjars/**",
"/css/**",
"/js/**",
"/images/**",
"/",
"/about/**",
"/contact/**",
"/error/**/*",
"/console/**"
};
return PUBLIC_MATCHERS;
}
}
But when I log to the application I got this message in the log file:
2018-04-11 11:27 [http-nio-5678-exec-7] WARN o.s.s.c.b.BCryptPasswordEncoder - Encoded password does not look like BCrypt
and I can't log in...and the password is correct. I have this error after update my app from SpringBoot 1 to SpringBoot 2