Kotlin: Get user claims from verified JWT

Extracts the JWT claims from the access token by first verifying the JWT against the server's JSON Web Key Set (JWKS) endpoint.

Parameters

Examples

Get claims from current session

val response = supabase.auth.getClaims()
val email = response.claims.email
val role = response.claims.role
val aal = response.claims.aal

Get a custom claim

val response = supabase.auth.getClaims()
val customValue = response.claims.getClaimOrNull<String>("my_custom_claim")

Verify a specific JWT

val response = supabase.auth.getClaims(jwt = "your-jwt-token")