Currently I got the main class:
package com.recweb.springboot;
import org.springframework.boot.SpringApplication;
im
@Override
public void configure(AuthenticationManagerBuilder auth) throws Exception{
auth.inMemoryAuthentication().passwordEncoder(NoOpPasswordEncoder.getInstance())
.withUser("test").password("test123").roles("USER").and()
.withUser("test1").password("test123").roles("ADMIN");
}
You need to set the password encoder like this:
@Bean
public PasswordEncoder passwordEncoder() {
return PasswordEncoderFactories.createDelegatingPasswordEncoder();
}
It's required to use the passwordEncoder for the users and also for the clients in Spring Boot 2
Check out this repository https://github.com/dzinot/spring-boot-2-oauth2-authorization-jwt
You can see how the passwordEncoder is set up and how to use it with users and clients in the database.
I simply added
@Bean
public static NoOpPasswordEncoder passwordEncoder() {
return (NoOpPasswordEncoder) NoOpPasswordEncoder.getInstance();
}
To the configuration class