getClaimOrNull

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

Returns the value of the named claim deserialized using the given serializer, or null if absent.

Return

the deserialized claim value, or null if the claim is not present

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)