Class ReactiveSecurityContextHolder
java.lang.Object
org.springframework.security.core.context.ReactiveSecurityContextHolder
Allows getting and setting the Spring
SecurityContext into a Context.- Since:
- 5.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic Function<reactor.util.context.Context,reactor.util.context.Context> Clears theMono<SecurityContext>from ReactorContextstatic reactor.core.publisher.Mono<SecurityContext>Gets theMono<SecurityContext>from ReactorContextstatic reactor.util.context.ContextwithAuthentication(Authentication authentication) A shortcut forwithSecurityContext(Mono)static reactor.util.context.ContextwithSecurityContext(reactor.core.publisher.Mono<? extends SecurityContext> securityContext) Creates a ReactorContextthat contains theMono<SecurityContext>that can be merged into anotherContext
-
Method Details
-
getContext
Gets theMono<SecurityContext>from ReactorContext- Returns:
- the
Mono<SecurityContext>
-
clearContext
Clears theMono<SecurityContext>from ReactorContext- Returns:
- Return a
Mono<Void>which only replays complete and error signals from clearing the context.
-
withSecurityContext
public static reactor.util.context.Context withSecurityContext(reactor.core.publisher.Mono<? extends SecurityContext> securityContext) Creates a ReactorContextthat contains theMono<SecurityContext>that can be merged into anotherContext- Parameters:
securityContext- theMono<SecurityContext>to set in the returned ReactorContext- Returns:
- a Reactor
Contextthat contains theMono<SecurityContext>
-
withAuthentication
A shortcut forwithSecurityContext(Mono)- Parameters:
authentication- theAuthenticationto be used- Returns:
- a Reactor
Contextthat contains theMono<SecurityContext>
-