getClaim

fun <T> getClaim(serializer: DeserializationStrategy<T>, name: String, jsonInstance: Json = Jwt.defaultJsonParser): T(source)

Returns the value of the named claim, deserialized using the given serializer.

Return

the deserialized claim value

Parameters

serializer

the deserialization strategy for type T

name

the claim name

jsonInstance

the Json instance to use for deserialization; defaults to the library's Jwt.defaultJsonParser configuration (ignoreUnknownKeys = true, explicitNulls = false)

Throws

if the claim is absent