鉴于我有两个身份验证提供程序:
<security:authentication-manager>
<security:authentication-provider user-service-ref="userDetailsService">
<security:password-encoder hash="sha-256">
<security:salt-source user-property="dateCreated" />
</security:password-encoder>
</security:authentication-provider>
<security:authentication-provider ref="ldapAuthProvider" />
</security:authentication-manager>
如果使用当前身份验证提供程序进行身份验证(在我的情况下为 {{1 }}) 失败。这些身份验证提供程序按优先级顺序列出(请参阅此处的 Thread)。
附言这是我维护的旧源代码,而不是我选择使用 XML 版本的 Spring Security。