requireClaim

inline fun <T> requireClaim(claimName: String, value: T): JwtParserBuilder(source)

Adds a validator that requires the named claim to equal the given value.

Return

this builder for chaining

Parameters

claimName

the name of the claim to validate

value

the expected value for the claim

Throws

if the claim is absent during parsing

if the claim does not match the expected value