春季安全的AuthenticationManager VS的AuthenticationProvider? [英] spring security AuthenticationManager vs AuthenticationProvider?

查看:202
本文介绍了春季安全的AuthenticationManager VS的AuthenticationProvider?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能告诉我一个AuthenticationManager会和春季安全性之间的AuthenticationProvider不同?

Can someone tell me different between an AuthenticationManager and an AuthenticationProvider in spring security?

如何使用它们,它们是怎么叫。这是我的理解是一个SecurityFilter类将调用到的AuthenticationManager认证的认证对象吗?但随后在什么地方的AuthenticationProvider发挥作用?

How are they used and how are they called. It is my understanding that a SecurityFilter will call the AuthenticationManager to authentication an Authentication object? But then where does the AuthenticationProvider come into play?

谢谢!

推荐答案

我觉得的AuthenticationManager 代表持久性的用户信息到一个或多个的AuthenticationProvider 秒。身份验证提供者( DaoAuthenticationProvider的时候,JaasAuthenticationProvider,LdapAuthenticationProvider可疑,OpenIDAuthenticationProvider 为例)专门访问特定的用户信息库。
有些东西在<一提到href=\"http://static.springsource.org/spring-security/site/docs/3.0.x/reference/ns-config.html#ns-auth-manager\">this参考手册的一部分。它说:

I think the AuthenticationManager delegates the fetching of persistent user information to one or more AuthenticationProviders. The authentication-providers (DaoAuthenticationProvider, JaasAuthenticationProvider, LdapAuthenticationProvider, OpenIDAuthenticationProvider for example) specialize in accessing specific user-info repositories. Something else is mentioned in this part of the reference manual. It says:

您可能想ProviderManager的注册其他的AuthenticationProvider豆,你可以使用带ref属性,在属性的值是您要添加的提供者bean的名字元素做到这一点。

在换句话说,你可以指定多个AuthenticationProviders,例如一个看起来对用户LDAP数据库中,另一个看起来在SQL数据库中。

In other words, you can specify multiple AuthenticationProviders, for example one that looks for users in an LDAP database and another that looks in an SQL database.

这篇关于春季安全的AuthenticationManager VS的AuthenticationProvider?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆