getHeader

inline fun <T> getHeader(jsonInstance: Json = Jwt.defaultJsonParser): T(source)

Deserializes the token header as type T.

Return

the header deserialized into an instance of T

Parameters

T

the target type to deserialize the header into

jsonInstance

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


fun <T> getHeader(serializer: KSerializer<T>, jsonInstance: Json = Jwt.defaultJsonParser): T(source)

Deserializes the token header using the given serializer.

Return

the header deserialized into an instance of T

Parameters

T

the target type to deserialize the header into

serializer

the KSerializer used to deserialize the header

jsonInstance

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