Class ReactiveSecurityContextHolder
- java.lang.Object
-
- org.springframework.security.core.context.ReactiveSecurityContextHolder
-
public final class ReactiveSecurityContextHolder extends java.lang.Object
Allows getting and setting the SpringSecurityContext
into aContext
.- Since:
- 5.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.function.Function<reactor.util.context.Context,reactor.util.context.Context>
clearContext()
Clears theMono<SecurityContext>
from ReactorContext
static reactor.core.publisher.Mono<SecurityContext>
getContext()
Gets theMono<SecurityContext>
from ReactorContext
static reactor.util.context.Context
withAuthentication(Authentication authentication)
A shortcut forwithSecurityContext(Mono)
static reactor.util.context.Context
withSecurityContext(reactor.core.publisher.Mono<? extends SecurityContext> securityContext)
Creates a ReactorContext
that contains theMono<SecurityContext>
that can be merged into anotherContext
-
-
-
Method Detail
-
getContext
public static reactor.core.publisher.Mono<SecurityContext> getContext()
Gets theMono<SecurityContext>
from ReactorContext
- Returns:
- the
Mono<SecurityContext>
-
clearContext
public static java.util.function.Function<reactor.util.context.Context,reactor.util.context.Context> 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 ReactorContext
that contains theMono<SecurityContext>
that can be merged into anotherContext
- Parameters:
securityContext
- theMono<SecurityContext>
to set in the returned ReactorContext
- Returns:
- a Reactor
Context
that contains theMono<SecurityContext>
-
withAuthentication
public static reactor.util.context.Context withAuthentication(Authentication authentication)
A shortcut forwithSecurityContext(Mono)
- Parameters:
authentication
- theAuthentication
to be used- Returns:
- a Reactor
Context
that contains theMono<SecurityContext>
-
-