check_claim: This function checks that a claim passed to the...

Description Usage Arguments Value

View source: R/utils_jwt.R

Description

This function checks that a claim passed to the is_authed_jwt function is valid in the given JWT. A claim consists of a claim name (e.g. "iss") and a claim value (e.g. "company A"). Claim values can also be named lists themselves. The function recursively extracts the value for claim_name from the payload. If the claim_value is atomic, it compares the retrieved value with the claimed value. Otherwise, it applies check_claim to claim_value recursively.

Usage

1
check_claim(claim_name, claim_value, payload)

Arguments

claim_name

name of the claim in the JWT, e.g. "iss".

claim_value

value the claim should have to pass the test.

payload

JWT payload extracted with jose::jwt_decode_hmac.

Value

TRUE if the claim is present in the JWT, FALSE if not.


jandix/sealr documentation built on Oct. 3, 2021, 1:16 p.m.