现在的位置: 首页 > 综合 > 正文

Acegi Authentication代码分析

2018年05月09日 ⁄ 综合 ⁄ 共 22752字 ⁄ 字号 评论关闭

1.在Acegi中是由认证管理器确定用户身份。一个认证管理器由借口AuthenticationManager实现。

 

2.Authentication 继承了java.security.Principal,Principal实现了简单的主体(Principal)定义。

 

3.Acegi提供了一个能适应大多数情况的ProviderManager,实现了AuthenticationManager, ProviderManager继承抽象类AbstractAuthenticationManager:

4.AuthenticationManager不依靠自己实现身份验证,而是通过Iterator逐个遍历AuthenticationProvider的子类集合(如果使用Spring的话子类类型由配置文件注入),直到某个Provider成功验证Authentication。

Acegi提供的Provider实现包括:
  AuthByAdapterProvider、CasAuthenticationProvider、DaoAuthenticationProvider、JaasAuthenticationProvider、PasswordDaoAuthenticationProvider、RemoteAuthenticationProvider、RunAsImplAuthenticationProvider、TestingAuthenticationProvider。
  下面只分析DaoAuthenticationProvider的相关类,按照AuthenticationProvider-->AbstractUserDetailsAuthenticationProvider-->DaoAuthenticationProvider的顺序展开。

 



抱歉!评论已关闭.