public class AnonymousForeverAuthenticationProvider extends Object implements org.springframework.security.authentication.AuthenticationProvider
与 SpringSecurity 提供的 AnonymousAuthenticationProvider 不同的是,该类不管任何类型的
Authentication,都返回匿名对象,以便用户携带了过期或者错误的 token 时转换为匿名用户身份兜底, 可配合
GlobalAuthenticationConfigurerAdapter 使用
AnonymousAuthenticationProvider,
AnonymousAuthenticationFilter| 构造器和说明 |
|---|
AnonymousForeverAuthenticationProvider(List<String> pathList) |
AnonymousForeverAuthenticationProvider(String key,
Object principal,
List<org.springframework.security.core.GrantedAuthority> authorities,
List<org.springframework.web.util.pattern.PathPattern> pathPatterns) |
| 限定符和类型 | 方法和说明 |
|---|---|
org.springframework.security.core.Authentication |
authenticate(org.springframework.security.core.Authentication authentication) |
protected org.springframework.security.core.Authentication |
createAuthentication(javax.servlet.http.HttpServletRequest request) |
void |
setAuthenticationDetailsSource(org.springframework.security.authentication.AuthenticationDetailsSource<javax.servlet.http.HttpServletRequest,?> authenticationDetailsSource) |
boolean |
supports(Class<?> authentication) |
public AnonymousForeverAuthenticationProvider(List<String> pathList)
public org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication)
throws org.springframework.security.core.AuthenticationException
authenticate 在接口中 org.springframework.security.authentication.AuthenticationProviderorg.springframework.security.core.AuthenticationExceptionpublic boolean supports(Class<?> authentication)
supports 在接口中 org.springframework.security.authentication.AuthenticationProviderprotected org.springframework.security.core.Authentication createAuthentication(javax.servlet.http.HttpServletRequest request)
public void setAuthenticationDetailsSource(org.springframework.security.authentication.AuthenticationDetailsSource<javax.servlet.http.HttpServletRequest,?> authenticationDetailsSource)
Copyright © 2023. All rights reserved.