Class InMemoryReactiveOneTimeTokenService
java.lang.Object
org.springframework.security.authentication.ott.reactive.InMemoryReactiveOneTimeTokenService
- All Implemented Interfaces:
ReactiveOneTimeTokenService
public final class InMemoryReactiveOneTimeTokenService
extends Object
implements ReactiveOneTimeTokenService
Reactive adapter for
InMemoryOneTimeTokenService- Since:
- 6.4
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<OneTimeToken>consume(OneTimeTokenAuthenticationToken authenticationToken) Consumes a one-time token based on the provided authentication token.reactor.core.publisher.Mono<OneTimeToken>generate(GenerateOneTimeTokenRequest request) Generates a one-time token based on the provided generate request.voidSets theClockused when generating one-time token and checking token expiry.
-
Constructor Details
-
InMemoryReactiveOneTimeTokenService
public InMemoryReactiveOneTimeTokenService()
-
-
Method Details
-
generate
Description copied from interface:ReactiveOneTimeTokenServiceGenerates a one-time token based on the provided generate request.- Specified by:
generatein interfaceReactiveOneTimeTokenService- Parameters:
request- the generate request containing the necessary information to generate the token- Returns:
- the generated
OneTimeToken.
-
consume
public reactor.core.publisher.Mono<OneTimeToken> consume(OneTimeTokenAuthenticationToken authenticationToken) Description copied from interface:ReactiveOneTimeTokenServiceConsumes a one-time token based on the provided authentication token.- Specified by:
consumein interfaceReactiveOneTimeTokenService- Parameters:
authenticationToken- the authentication token containing the one-time token value to be consumed- Returns:
- the consumed
OneTimeTokenor empty Mono if the token is invalid
-
setClock
Sets theClockused when generating one-time token and checking token expiry.- Parameters:
clock- the clock
-