Builder
Builder for constructing a JwtPayload with standard and custom claims.
Properties
Functions
Link copied to clipboard
Sets a typed claim, inferring the serializer from the reified type T.
Sets a raw claim using a pre-built JsonElement, or removes it if value is null.
fun <T> claim(name: String, serializer: SerializationStrategy<T>, value: T?, jsonInstance: Json = Jwt.defaultJsonParser)
Sets a typed claim using an explicit SerializationStrategy.
Link copied to clipboard
Sets the not-before (nbf) claim to the current time.
Link copied to clipboard
Sets the JWT ID (jti) claim to a randomly generated UUID.
Link copied to clipboard
fun <T> takeFrom(serializer: SerializationStrategy<T>, value: T, jsonInstance: Json = Jwt.defaultJsonParser)
Merges all fields from value into this builder, encoded using serializer.