Learn R Programming

autosync (version 0.2.0)

validate_token: Validate a JWT token

Description

Verifies a JWT locally using the issuer's public keys (JWKS) and validates standard OIDC claims.

Usage

validate_token(
  token,
  issuer,
  client_id,
  allowed_emails = NULL,
  allowed_domains = NULL,
  custom_validator = NULL
)

Value

List with valid (logical), email (character or NULL), error (character or NULL).

Arguments

token

Character string, the JWT.

issuer

Expected issuer URL.

client_id

Expected audience (client ID).

allowed_emails

Character vector of allowed email addresses (optional).

allowed_domains

Character vector of allowed email domains (optional).

custom_validator

Function(claims) returning TRUE/FALSE (optional).