cxxmcp 1.1.6
C++ MCP SDK
Loading...
Searching...
No Matches
jwt.hpp File Reference

OpenSSL-backed JWT verification over a trusted JWKS value. More...

#include <algorithm>
#include <chrono>
#include <cstdint>
#include <limits>
#include <nlohmann/json.hpp>
#include <optional>
#include <string>
#include <utility>
#include <vector>
#include "cxxmcp/auth/dpop.hpp"
#include "cxxmcp/auth/jwks.hpp"
#include "cxxmcp/auth/openssl/jws_verify.hpp"
#include "cxxmcp/core/result.hpp"

Go to the source code of this file.

Classes

class  mcp::auth::openssl::StaticJwksJwtVerifier
 
struct  mcp::auth::openssl::FetchingJwksJwtVerifierOptions
 
class  mcp::auth::openssl::FetchingJwksJwtVerifier
 JWT verifier that fetches and caches JWKS through injected SDK boundaries. More...
 

Functions

core::Error mcp::auth::openssl::detail::jwt_error (std::string message, std::string detail={})
 
TimePoint mcp::auth::openssl::detail::jwt_time_from_unix_seconds (std::int64_t seconds)
 
std::optional< std::int64_t > mcp::auth::openssl::detail::jwt_numeric_date (const nlohmann::json &object, const char *key)
 
std::optional< std::string > mcp::auth::openssl::detail::jwt_string_claim (const nlohmann::json &object, const char *key)
 
std::string mcp::auth::openssl::detail::jwt_claim_to_metadata_value (const nlohmann::json &value)
 
bool mcp::auth::openssl::detail::jwt_required_claim_matches (const nlohmann::json &payload, const std::string &key, const std::string &expected)
 
bool mcp::auth::openssl::detail::jwt_audience_matches (const nlohmann::json &payload, const std::string &expected)
 
std::string mcp::auth::openssl::detail::jwt_verified_audience (const nlohmann::json &payload, const std::optional< std::string > &expected)
 
MetadataMap mcp::auth::openssl::detail::jwt_claims_metadata (const nlohmann::json &payload)
 
core::Result< nlohmann::json > mcp::auth::openssl::detail::parse_jwt_payload_json (const std::vector< unsigned char > &payload)
 
bool mcp::auth::openssl::detail::jwt_error_should_refresh_jwks (const core::Error &error)
 
core::Result< VerifiedJwtClaimsmcp::auth::openssl::verify_jwt_with_jwks (const JwtVerificationRequest &request, const JsonWebKeySet &jwks)
 

Detailed Description

OpenSSL-backed JWT verification over a trusted JWKS value.