Token

@Serializable
data class Token(val accessToken: String = "", val tokenType: String? = null, val scope: String? = null, val expiresIn: Long = 0, val refreshToken: String? = null, val idToken: String? = null, expireAt: Long = now() + expiresIn)

Data class representing an OIDC token.

Constructors

Link copied to clipboard
constructor(accessToken: String = "", tokenType: String? = null, scope: String? = null, expiresIn: Long = 0, refreshToken: String? = null, idToken: String? = null, expireAt: Long = now() + expiresIn)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
@SerialName(value = "access_token")
val accessToken: String

The access token.

Link copied to clipboard
@SerialName(value = "expires_in")
val expiresIn: Long = 0

The duration in seconds for which the token is valid.

Link copied to clipboard
@SerialName(value = "id_token")
val idToken: String? = null

The ID token.

Link copied to clipboard

Checks if the token is expired.

Link copied to clipboard
@SerialName(value = "refresh_token")
val refreshToken: String? = null

The refresh token.

Link copied to clipboard
@SerialName(value = "scope")
val scope: String? = null

The scope of the token.

Link copied to clipboard
@SerialName(value = "token_type")
val tokenType: String? = null

The type of the token.

Functions

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

Checks if the token is expired considering a threshold.