AuthToken

@Serializable
data class AuthToken(val accessToken: String? = null, val refreshToken: String? = null, val accessTokenLifetime: Long? = null, val refreshTokenLifetime: Long? = null, val payload: String? = null)(source)

Constructors

Link copied to clipboard
constructor(accessToken: String? = null, refreshToken: String? = null, accessTokenLifetime: Long? = null, refreshTokenLifetime: Long? = null, payload: String? = null)

Properties

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

This is the general access tokens/api token representing a logged in user. Access tokens are the thing that applications use to make API requests on behalf of a user.

Link copied to clipboard
@SerialName(value = "accessTokenLifetime")
val accessTokenLifetime: Long?

In UnixTime (sec) when it expires

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

Sometimes AuthToken needs to be customized to store e.g. username/password, this acts as a catch all to store text or JSON data.

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

For OAuth a special refresh token is issues to refresh the access token.

Link copied to clipboard
@SerialName(value = "refreshTokenLifetime")
val refreshTokenLifetime: Long?

In UnixTime (sec) when it expires

Functions

Link copied to clipboard
fun isAccessTokenExpired(marginSec: Long = 10): Boolean
Link copied to clipboard
fun isRefreshTokenExpired(marginSec: Long = 10): Boolean