qb  2.0.0.0
C++17 Actor Framework
qb Issue Watch Star Fork Follow @isndev
Loading...
Searching...
No Matches
qb::jwt::VerifyOptions Struct Reference

JWT verification options. More...

#include <crypto_jwt.h>

Public Attributes

Algorithm algorithm
 The algorithm expected for the token signature.
std::string key
 Secret key for HMAC algorithms, or PEM-encoded public key for asymmetric algorithms.
bool verify_expiration
 Whether to validate the exp (expiration time) claim.
bool verify_not_before
 Whether to validate the nbf (not before) claim.
bool verify_issuer
 Whether to validate the iss (issuer) claim.
std::optional< std::string > issuer
 Expected issuer if verify_issuer is true.
bool verify_audience
 Whether to validate the aud (audience) claim.
std::optional< std::string > audience
 Expected audience if verify_audience is true.
bool verify_subject
 Whether to validate the sub (subject) claim.
std::optional< std::string > subject
 Expected subject if verify_subject is true.
bool verify_jti
 Whether to validate the jti (JWT ID) claim.
std::optional< std::string > jti
 Expected JWT ID if verify_jti is true.
std::chrono::seconds clock_skew
 Clock skew tolerance for exp and nbf validations.
std::map< std::string, std::string > required_claims
 Additional custom claims that must be present in the payload and match the provided values.

Detailed Description

JWT verification options.

Member Data Documentation

◆ verify_expiration

bool qb::jwt::VerifyOptions::verify_expiration

Whether to validate the exp (expiration time) claim.

Default true.

◆ verify_not_before

bool qb::jwt::VerifyOptions::verify_not_before

Whether to validate the nbf (not before) claim.

Default true.

◆ verify_issuer

bool qb::jwt::VerifyOptions::verify_issuer

Whether to validate the iss (issuer) claim.

Default false.

◆ verify_audience

bool qb::jwt::VerifyOptions::verify_audience

Whether to validate the aud (audience) claim.

Default false.

◆ audience

std::optional<std::string> qb::jwt::VerifyOptions::audience

Expected audience if verify_audience is true.

Can be a single string or a JSON array of strings.

◆ verify_subject

bool qb::jwt::VerifyOptions::verify_subject

Whether to validate the sub (subject) claim.

Default false.

◆ verify_jti

bool qb::jwt::VerifyOptions::verify_jti

Whether to validate the jti (JWT ID) claim.

Default false.

◆ clock_skew

std::chrono::seconds qb::jwt::VerifyOptions::clock_skew

Clock skew tolerance for exp and nbf validations.

Default 0 seconds.