Package org.springframework.security.authentication.ott.reactive

# 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:
  - `InMemoryOneTimeTokenService`

## Constructor Summary

Constructors
Constructor
Description
`InMemoryReactiveOneTimeTokenService()`

## Method Summary

Modifier and Type
Method
Description
`reactor.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`
`setClock(Clock clock)`
Sets the `Clock` used when generating one-time token and checking token expiry.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### InMemoryReactiveOneTimeTokenService

public InMemoryReactiveOneTimeTokenService()

## Method Details

### generate

public reactor.core.publisher.Mono<OneTimeToken> generate(GenerateOneTimeTokenRequest request)
Description copied from interface: `ReactiveOneTimeTokenService`
Generates a one-time token based on the provided generate request.

Specified by:
  `generate` in interface `ReactiveOneTimeTokenService`
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 interface `ReactiveOneTimeTokenService`
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

public void setClock(Clock clock)
Sets the `Clock` used when generating one-time token and checking token expiry.

Parameters:
  `clock` - the clock