CasAuthenticationFilter 简介|(版本:3.0.7)
处理Cas service ticket
Service Tickets
一个服务票据是由一串加密的票证字符串组成, 服务票据是用户的浏览器通过Cas Server 认证后, 通过HTTP Redirect 到资源服务器中, 而服务票据是通过其中的请求参数中获取到的。
过滤器监视着Service URL 以致于它可以接收到服务票据并进行处理,The CAS server knows which service URL to use via the ServiceProperties.getService() method。
Processing the service ticket involves creating a UsernamePasswordAuthenticationToken(the principal and the opaque ticket string as the credentials) which uses CAS_STATEFUL_IDENTIFIER for the principal and the opaque ticket string as the credentials.(通过服务票据生成 UsernamePasswordAuthenticationToken)
The configured AuthenticationManager is expected to provide a provider that can recognise UsernamePasswordAuthenticationTokens containing this special principal name, and process them accordingly by validation with the CAS server.(通过AuthenticationManager 依据Cas server 来处理识别该证书)
By configuring a shared ProxyGrantingTicketStorage between the TicketValidator and the CasAuthenticationFilter one can have the CasAuthenticationFilter handle the proxying requirements for CAS. In addition, the URI endpoint for the proxying would also need to be configured (i.e. the part after protocol, hostname, and port).(代理相关)
Spring Secutiry 登陆基本流程(源码分析)
1 | /** |
补充
- addFilterBefore(filter, class) – adds a filter before the position of the specified filter class
- addFilterAfter(filter, class) – adds a filter after the position of the specified filter class
- addFilterAt(filter, class) – adds a filter at the location of the specified filter class
- addFilter(filter) – adds a filter that must be an instance of or extend one of the filters provided by Spring Security