There is no PasswordEncoder mapped for the id "null"

Posted java51

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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"/>

以上是关于There is no PasswordEncoder mapped for the id "null"的主要内容,如果未能解决你的问题,请参考以下文章

There is no known eureka server; cluster server list is empty

Struts2注解错误之There is no Action mapped for namespace /

mybatis There is no getter for property named 'xxxx

YES, There is No such thing as a free lunch

SassError: There is no module with the namespace “math“

SassError: There is no module with the namespace “math“