Package org.springframework.security.authentication.ott

# Class DefaultOneTimeToken

java.lang.Object
org.springframework.security.authentication.ott.DefaultOneTimeToken

All Implemented Interfaces:
  `OneTimeToken`

public class DefaultOneTimeToken extends Object implements OneTimeToken
A default implementation of `OneTimeToken`

Since:
  6.4

## Constructor Summary

Constructors
Constructor
Description
`DefaultOneTimeToken(String token, String username, Instant expireAt)`

## Method Summary

Modifier and Type
Method
Description
`Instant`
`getExpiresAt()`
`String`
`getTokenValue()`
`String`
`getUsername()`

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

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

## Constructor Details

### DefaultOneTimeToken

public DefaultOneTimeToken(String token, String username, Instant expireAt)

## Method Details

### getTokenValue

public String getTokenValue()

Specified by:
  `getTokenValue` in interface `OneTimeToken`
Returns:
  the one-time token value, never `null`

### getUsername

public String getUsername()

Specified by:
  `getUsername` in interface `OneTimeToken`
Returns:
  the username associated with this token, never `null`

### getExpiresAt

public Instant getExpiresAt()

Specified by:
  `getExpiresAt` in interface `OneTimeToken`
Returns:
  the expiration time of the token