AccessToken

@Serializable
data class AccessToken(val value: String = "", val tokenType: String? = null, val scope: AccessToken.Scope? = null, val expiresIn: Long = 0, val refreshToken: String? = null, val idToken: String? = null, var expiration: Date? = null, val sessionToken: SSOToken? = null) : Token

Models an OAuth2 access token.

Constructors

Link copied to clipboard
constructor(value: String = "", tokenType: String? = null, scope: AccessToken.Scope? = null, expiresIn: Long = 0, refreshToken: String? = null, idToken: String? = null, expiration: Date? = null, sessionToken: SSOToken? = null)

Types

Link copied to clipboard

Builder class for AccessToken.

Link copied to clipboard
object Companion
Link copied to clipboard
@Serializable
class Scope : HashSet<String>

Represents the authorization scope of the access token.

Properties

Link copied to clipboard
@Serializable(with = DateSerializer::class)
var expiration: Date?

The date and time when the access token expires.

Link copied to clipboard
val expiresIn: Long = 0

The duration (in seconds) for which the access token is valid.

Link copied to clipboard
val idToken: String? = null

The ID token associated with the access token.

Link copied to clipboard

Checks if the access token is expired.

Link copied to clipboard
@Transient
var isPersisted: Boolean
Link copied to clipboard
val refreshToken: String? = null

The refresh token which can be used to obtain new access tokens.

Link copied to clipboard
@Serializable(with = ScopeSerializer::class)
val scope: AccessToken.Scope? = null

The scope of the access token which defines the resources that the access token can access.

Link copied to clipboard
@Serializable(with = SSOTokenSerializer::class)
val sessionToken: SSOToken? = null

The session token associated with the access token.

Link copied to clipboard
val tokenType: String? = null

The type of the token (usually "Bearer").

Link copied to clipboard
open override val value: String

The value of the access token.

Functions

Link copied to clipboard
fun isExpired(threshold: Long): Boolean

Checks if the access token is expired.

Link copied to clipboard
fun toJson(): String