其他分享
首页 > 其他分享> > There is no PasswordEncoder mapped for the id "null"

There is no PasswordEncoder mapped for the id "null"

作者:互联网

因为Spring-Security从4+升级到5+,导致There is no PasswordEncoder mapped for the id “null”错误。

解决方案:
1.可在密码验证类中添加
@Bean
public static NoOpPasswordEncoder passwordEncoder() {
  return (NoOpPasswordEncoder) NoOpPasswordEncoder.getInstance();
}


2.或者在xml配置文件中添加
<b:bean id="passwordEncoder"    class="org.springframework.security.crypto.password.NoOpPasswordEncoder" factory-method="getInstance"/>

标签:NoOpPasswordEncoder,no,There,PasswordEncoder,null,id
来源: https://www.cnblogs.com/java51/p/12080765.html