All Downloads are FREE. Search and download functionalities are using the official Maven repository.

main.com.stytch.java.common.JWTException.kt Maven / Gradle / Ivy

There is a newer version: 6.0.0
Show newest version
package com.stytch.java.common

public sealed class JWTException(
    public open val exception: Exception? = null,
    public open val reason: String? = null,
) : IllegalStateException() {
    public data class JwtError(override val exception: Exception) : JWTException(exception = exception)

    public data class JwtTooOld(val iat: Long, val maxTokenAgeSeconds: Int) : JWTException(
        reason = "JWT was issued at $iat, more than $maxTokenAgeSeconds seconds ago",
    )

    public object JwtMissingClaims : JWTException()

    public object MissingRolesClaim : JWTException(reason = "Missing roles claim field")

    public data class JwtMissingScopes(val missingScopes: List) : JWTException(
        reason = "Missing required scopes: $missingScopes",
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy