Class AnonymousPayloadInterceptor
- java.lang.Object
-
- org.springframework.security.rsocket.authentication.AnonymousPayloadInterceptor
-
- All Implemented Interfaces:
org.springframework.core.Ordered,PayloadInterceptor
public class AnonymousPayloadInterceptor extends java.lang.Object implements PayloadInterceptor, org.springframework.core.Ordered
IfReactiveSecurityContextHolderis empty populates anAnonymousAuthenticationToken- Since:
- 5.2
-
-
Constructor Summary
Constructors Constructor Description AnonymousPayloadInterceptor(java.lang.String key)Creates a filter with a principal named "anonymousUser" and the single authority "ROLE_ANONYMOUS".AnonymousPayloadInterceptor(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 intgetOrder()reactor.core.publisher.Mono<java.lang.Void>intercept(PayloadExchange exchange, PayloadInterceptorChain chain)Process the Web request and (optionally) delegate to the nextPayloadInterceptorthrough the givenPayloadInterceptorChain.voidsetOrder(int order)
-
-
-
Constructor Detail
-
AnonymousPayloadInterceptor
public AnonymousPayloadInterceptor(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
-
AnonymousPayloadInterceptor
public AnonymousPayloadInterceptor(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
-
getOrder
public int getOrder()
- Specified by:
getOrderin interfaceorg.springframework.core.Ordered
-
setOrder
public void setOrder(int order)
-
intercept
public reactor.core.publisher.Mono<java.lang.Void> intercept(PayloadExchange exchange, PayloadInterceptorChain chain)
Description copied from interface:PayloadInterceptorProcess the Web request and (optionally) delegate to the nextPayloadInterceptorthrough the givenPayloadInterceptorChain.- Specified by:
interceptin interfacePayloadInterceptor- Parameters:
exchange- the current payload exchangechain- provides a way to delegate to the next interceptor- Returns:
Mono<Void>to indicate when payload processing is complete
-
-