JWT-CPP v0.7.0
A header only library for creating and validating JSON Web Tokens (JWT) in C++
Loading...
Searching...
No Matches
jwt::verify_ops::verify_context< json_traits > Struct Template Reference

#include <jwt.h>

Public Member Functions

 verify_context (date ctime, const decoded_jwt< json_traits > &j, size_t l)
 
basic_claim< json_traits > get_claim (bool in_header, std::error_code &ec) const
 Helper method to get a claim from the jwt in this context.
 
basic_claim< json_traits > get_claim (bool in_header, json::type t, std::error_code &ec) const
 
basic_claim< json_traits > get_claim (std::error_code &ec) const
 Helper method to get a payload claim from the jwt.
 
basic_claim< json_traits > get_claim (json::type t, std::error_code &ec) const
 Helper method to get a payload claim of a specific type from the jwt.
 

Public Attributes

date current_time
 Current time, retrieved from the verifiers clock and cached for performance and consistency.
 
const decoded_jwt< json_traits > & jwt
 The jwt passed to the verifier.
 
size_t default_leeway {0}
 The configured default leeway for this verification.
 
json_traits::string_type claim_key {}
 The claim key to apply this comparison on.
 

Detailed Description

template<typename json_traits>
struct jwt::verify_ops::verify_context< json_traits >

This is the base container which holds the token that need to be verified

Member Function Documentation

◆ get_claim() [1/4]

template<typename json_traits >
basic_claim< json_traits > jwt::verify_ops::verify_context< json_traits >::get_claim ( bool in_header,
json::type t,
std::error_code & ec ) const
inline

Helper method to get a claim of a specific type from the jwt in this context

Parameters
in_headercheck JWT header or payload sections
tthe expected type of the claim
ecstd::error_code which will indicate if any error occure
Returns
basic_claim if it was present otherwise empty

◆ get_claim() [2/4]

template<typename json_traits >
basic_claim< json_traits > jwt::verify_ops::verify_context< json_traits >::get_claim ( bool in_header,
std::error_code & ec ) const
inline

Helper method to get a claim from the jwt in this context.

Parameters
in_headercheck JWT header or payload sections
ecstd::error_code which will indicate if any error occure
Returns
basic_claim if it was present otherwise empty

◆ get_claim() [3/4]

template<typename json_traits >
basic_claim< json_traits > jwt::verify_ops::verify_context< json_traits >::get_claim ( json::type t,
std::error_code & ec ) const
inline

Helper method to get a payload claim of a specific type from the jwt.

Parameters
tthe expected type of the claim
ecstd::error_code which will indicate if any error occure
Returns
basic_claim if it was present otherwise empty

◆ get_claim() [4/4]

template<typename json_traits >
basic_claim< json_traits > jwt::verify_ops::verify_context< json_traits >::get_claim ( std::error_code & ec) const
inline

Helper method to get a payload claim from the jwt.

Parameters
ecstd::error_code which will indicate if any error occure
Returns
basic_claim if it was present otherwise empty

The documentation for this struct was generated from the following file: