Goby3
3.1.5a
2024.05.23
|
#include <goby/util/thirdparty/jwt-cpp/jwt.h>
Public Types | |
using | basic_claim_t = basic_claim< json_traits > |
using | verify_check_fn_t = std::function< void(const verify_ops::verify_context< json_traits > &, std::error_code &ec)> |
Public Member Functions | |
verifier (Clock c) | |
verifier & | leeway (size_t leeway) |
verifier & | expires_at_leeway (size_t leeway) |
verifier & | not_before_leeway (size_t leeway) |
verifier & | issued_at_leeway (size_t leeway) |
verifier & | with_type (const typename json_traits::string_type &type, std::locale locale=std::locale{}) |
verifier & | with_issuer (const typename json_traits::string_type &iss) |
verifier & | with_subject (const typename json_traits::string_type &sub) |
verifier & | with_audience (const typename basic_claim_t::set_t &aud) |
verifier & | with_audience (const typename json_traits::string_type &aud) |
verifier & | with_id (const typename json_traits::string_type &id) |
verifier & | with_claim (const typename json_traits::string_type &name, verify_check_fn_t fn) |
verifier & | with_claim (const typename json_traits::string_type &name, basic_claim_t c) |
template<typename Algorithm > | |
verifier & | allow_algorithm (Algorithm alg) |
void | verify (const decoded_jwt< json_traits > &jwt) const |
void | verify (const decoded_jwt< json_traits > &jwt, std::error_code &ec) const |
Verifier class used to check if a decoded token contains all claims required by your application and has a valid signature.
using jwt::verifier< Clock, json_traits >::basic_claim_t = basic_claim<json_traits> |
using jwt::verifier< Clock, json_traits >::verify_check_fn_t = std::function<void(const verify_ops::verify_context<json_traits>&, std::error_code& ec)> |
Verification function
This gets passed the current verifier, a reference to the decoded jwt, a reference to the key of this claim, as well as a reference to an error_code. The function checks if the actual value matches certain rules (e.g. equality to value x) and sets the error_code if it does not. Once a non zero error_code is encountered the verification stops and this error_code becomes the result returned from verify
|
inlineexplicit |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Set an type to check for.
According to RFC 7519 Section 5.1, This parameter is ignored by JWT implementations; any processing of this parameter is performed by the JWT application. Check is casesensitive.
type | Type Header Parameter to check for. |
locale | Localization functionality to use when comapring |