![](/img/trans.png)
[英]Spring security with multiple authentication providers - UsernameNotFoundException
[英]Understanding authentication providers in Spring security
我试图了解Spring(3.1)中的身份验证提供程序,但对这里到底发生了什么有疑问。 我知道我使用的命名空间可以更轻松地访问安全模块中的功能和配置。
当我具有以下标签时,我将获得一个提供程序管理器,其中包含身份验证提供程序的列表。 现在,当我查看AuthenticationProvider
接口时,我想知道我获得了哪种提供程序? 我可以得到DaoAuthenticationProvider
吗? 我可以获得其他提供商吗?如何找到要注册的提供商(如果这样做的话)?
<security:authentication-manager>
<security:authentication-provider>
<security:jdbc-user-service data-source-ref="dataSource" />
</security:authentication-provider>
</security:authentication-manager>
没错,您将获得带有上述配置的DaoAuthenticationProvider
。 <authentication-provider>
的文档明确指出:
除非与
ref
属性一起使用,否则此元素是配置DaoAuthenticationProvider
简写。
<authentication-provider>
标记由AuthenticationProviderBeanDefinitionParser
解析,该标识符始终注册使用指定UserDetailsService
和其他协作者(passwordEncoder,saltSource等)注入的DaoAuthenticationProvider
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.