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
-
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.void
Sets theClock
used when generating one-time token and checking token expiry.
-
Constructor Details
-
InMemoryReactiveOneTimeTokenService
public InMemoryReactiveOneTimeTokenService()
-
-
Method Details
-
generate
Description copied from interface:ReactiveOneTimeTokenService
Generates a one-time token based on the provided generate request.- Specified by:
generate
in 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:ReactiveOneTimeTokenService
Consumes a one-time token based on the provided authentication token.- Specified by:
consume
in interfaceReactiveOneTimeTokenService
- Parameters:
authenticationToken
- the authentication token containing the one-time token value to be consumed- Returns:
- the consumed
OneTimeToken
or empty Mono if the token is invalid
-
setClock
Sets theClock
used when generating one-time token and checking token expiry.- Parameters:
clock
- the clock
-