Class AnonymousAuthenticationWebFilter
- java.lang.Object
-
- org.springframework.security.web.server.authentication.AnonymousAuthenticationWebFilter
-
- All Implemented Interfaces:
org.springframework.web.server.WebFilter
public class AnonymousAuthenticationWebFilter extends java.lang.Object implements org.springframework.web.server.WebFilter
Detects if there is noAuthentication
object in theReactiveSecurityContextHolder
, and populates it with one if needed.- Since:
- 5.2.0
-
-
Constructor Summary
Constructors Constructor Description AnonymousAuthenticationWebFilter(java.lang.String key)
Creates a filter with a principal named "anonymousUser" and the single authority "ROLE_ANONYMOUS".AnonymousAuthenticationWebFilter(java.lang.String key, java.lang.Object principal, java.util.List<GrantedAuthority> authorities)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Authentication
createAuthentication(org.springframework.web.server.ServerWebExchange exchange)
reactor.core.publisher.Mono<java.lang.Void>
filter(org.springframework.web.server.ServerWebExchange exchange, org.springframework.web.server.WebFilterChain chain)
-
-
-
Constructor Detail
-
AnonymousAuthenticationWebFilter
public AnonymousAuthenticationWebFilter(java.lang.String key)
Creates a filter with a principal named "anonymousUser" and the single authority "ROLE_ANONYMOUS".- Parameters:
key
- the key to identify tokens created by this filter
-
AnonymousAuthenticationWebFilter
public AnonymousAuthenticationWebFilter(java.lang.String key, java.lang.Object principal, java.util.List<GrantedAuthority> authorities)
- Parameters:
key
- key the key to identify tokens created by this filterprincipal
- the principal which will be used to represent anonymous usersauthorities
- the authority list for anonymous users
-
-
Method Detail
-
filter
public reactor.core.publisher.Mono<java.lang.Void> filter(org.springframework.web.server.ServerWebExchange exchange, org.springframework.web.server.WebFilterChain chain)
- Specified by:
filter
in interfaceorg.springframework.web.server.WebFilter
-
createAuthentication
protected Authentication createAuthentication(org.springframework.web.server.ServerWebExchange exchange)
-
-