Spring Security 无法登陆,报错:There is no PasswordEncoder mapped for the id “null”
程序员文章站
2022-04-14 22:42:27
...
Spring Security 无法登陆,报如下错误!
auth.inMemoryAuthentication()
.withUser("java1234")
.password("123456")
.roles("ADMIN");
使用如下代码就解决ok!
auth.inMemoryAuthentication().passwordEncoder(new BCryptPasswordEncoder()).withUser("java1234").password(new BCryptPasswordEncoder().encode("123456")).roles("ADMIN");
参考自:https://blog.csdn.net/canon_in_d_major/article/details/79675033