File tree 2 files changed +4
-4
lines changed
example-14-jdbc-auth-security/src/main/java/io/sfe/jdbcsecurity
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 2
2
3
3
import org .springframework .context .annotation .Bean ;
4
4
import org .springframework .context .annotation .Configuration ;
5
- import org .springframework .security .crypto .bcrypt . BCryptPasswordEncoder ;
5
+ import org .springframework .security .crypto .factory . PasswordEncoderFactories ;
6
6
import org .springframework .security .crypto .password .PasswordEncoder ;
7
7
8
8
@ Configuration
9
9
public class PasswordEncoderConfig {
10
10
11
11
@ Bean
12
12
public PasswordEncoder passwordEncoder () {
13
- return new BCryptPasswordEncoder ();
13
+ return PasswordEncoderFactories . createDelegatingPasswordEncoder ();
14
14
}
15
15
}
Original file line number Diff line number Diff line change @@ -21,14 +21,14 @@ public AuthenticationManager authenticationManager(
21
21
authenticationManagerBuilder
22
22
.inMemoryAuthentication ()
23
23
.withUser ("admin" )
24
- .password ("$2a$10$rkWfnHrSpo0JyNBH4tHRDOeuZACtCU5v4sCQpleWl4P41YuYqQMjC" ) //admin
24
+ .password ("{bcrypt} $2a$10$rkWfnHrSpo0JyNBH4tHRDOeuZACtCU5v4sCQpleWl4P41YuYqQMjC" ) //admin
25
25
.roles ("ADMIN" );
26
26
27
27
authenticationManagerBuilder
28
28
.jdbcAuthentication ()
29
29
.dataSource (dataSource )
30
30
.withUser ("user" )
31
- .password ("$2a$10$GlpFG1Ml3U9AvkOu0D1B9ufnoquX5xqCR/NHaMfBZliYgPa8/e5sK" )
31
+ .password ("{bcrypt} $2a$10$GlpFG1Ml3U9AvkOu0D1B9ufnoquX5xqCR/NHaMfBZliYgPa8/e5sK" )
32
32
.roles ("USER" );
33
33
34
34
return authenticationManagerBuilder .build ();
You can’t perform that action at this time.
0 commit comments