PACS System 0.1.0
PACS DICOM system library
Loading...
Searching...
No Matches
jwt_validator.h File Reference

JWT (JSON Web Token) validation for OAuth 2.0. More...

#include "kcenon/pacs/web/auth/oauth2_config.h"
#include <cstdint>
#include <optional>
#include <string>
#include <string_view>
#include <vector>
Include dependency graph for jwt_validator.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  kcenon::pacs::web::auth::jwt_header
 Decoded JWT header (JOSE header) More...
 
struct  kcenon::pacs::web::auth::jwt_claims
 Decoded JWT claims (payload) More...
 
struct  kcenon::pacs::web::auth::jwt_token
 Decoded JWT token with raw segments for signature verification. More...
 
class  kcenon::pacs::web::auth::jwt_validator
 

Namespaces

namespace  kcenon
 
namespace  kcenon::pacs
 
namespace  kcenon::pacs::web
 
namespace  kcenon::pacs::web::auth
 

Enumerations

enum class  kcenon::pacs::web::auth::jwt_error {
  kcenon::pacs::web::auth::none , kcenon::pacs::web::auth::malformed_token , kcenon::pacs::web::auth::invalid_base64 , kcenon::pacs::web::auth::invalid_json ,
  kcenon::pacs::web::auth::unsupported_algorithm , kcenon::pacs::web::auth::invalid_signature , kcenon::pacs::web::auth::token_expired , kcenon::pacs::web::auth::token_not_yet_valid ,
  kcenon::pacs::web::auth::invalid_issuer , kcenon::pacs::web::auth::invalid_audience , kcenon::pacs::web::auth::missing_required_claim , kcenon::pacs::web::auth::signature_not_available
}
 JWT validation error codes. More...
 

Functions

std::string_view kcenon::pacs::web::auth::jwt_error_message (jwt_error error) noexcept
 Get human-readable description for a JWT error.
 
std::optional< std::string > kcenon::pacs::web::auth::base64url_decode (std::string_view input)
 Decode a Base64url-encoded string (RFC 4648 Section 5)
 

Detailed Description

JWT (JSON Web Token) validation for OAuth 2.0.

Provides JWT parsing, claim validation, and cryptographic signature verification using OpenSSL. Supports RS256 and ES256 algorithms.

See also
RFC 7519 - JSON Web Token (JWT)
RFC 7518 - JSON Web Algorithms (JWA)
Issue #860 - Add OAuth 2.0 configuration and JWT token validation core
Author
kcenon
Since
1.0.0

Definition in file jwt_validator.h.