Create and encode a JWTSource:
jwt_claim() is a wrapper around
jose::jwt_claim() that creates a JWT
claim set with a few extra default values.
jwt_encode_hmac() are thin wrappers around
jose::jwt_encode_hmac() that exist primarily to make specification
in other functions a little simpler.
Issuer claim. Identifies the principal that issued the JWT.
Subject claim. Identifies the principal that is the subject of the JWT (i.e. the entity that the claims apply to).
Audience claim. Identifies the recipients that the JWT is intended. Each principle intended to process the JWT must be identifid with a unique value.
Expiration claim. Identifies the expiration time on or after which the JWT MUST NOT be accepted for processing. Defaults to 5 minutes.
Not before claim. Identifies the time before which the JWT MUST NOT be accepted for processing. Defaults to current time.
Issued at claim. Identifies the time at which the JWT was issued. Defaults to current time.
JWT ID claim. Provides a unique identifier for the JWT. If omitted, uses a random 32-byte sequence encoded with base64url.
Any additional claims to include in the claim set.
Claim set produced by
RSA or EC private key either specified as a path to a file, a connection, or a string (PEM/SSH format), or a raw vector (DER format).
Size, in bits, of sha2 signature, i.e. 256, 384 or 512. Only for HMAC/RSA, not applicable for ECDSA keys.
A named list giving additional fields to include in the JWT header.
String or raw vector with a secret passphrase.
claim <- jwt_claim() str(claim) #> List of 4 #> $ exp: num 1.66e+09 #> $ nbf: num 1.66e+09 #> $ iat: num 1.66e+09 #> $ jti: chr "m5GcGLQo4LpJBiMzKiPBna0vd04jgKZANNrxaCRXcPc" #> - attr(*, "class")= chr [1:2] "jwt_claim" "list"