4#ifndef _Stroika_Foundation_DataExchange_JSON_JWT_h_
5#define _Stroika_Foundation_DataExchange_JSON_JWT_h_ 1
7#include "Stroika/Frameworks/StroikaPreComp.h"
10#include "Stroika/Foundation/Containers/Mapping.h"
30 namespace JWTRegisteredClaims {
66 constexpr string_view
kJWTID =
"jti"sv;
100 JWT (
const String& encodedString,
bool fullyValidate =
true);
116 nonvirtual optional<String> GetIssuer ()
const;
121 nonvirtual optional<String> GetSubject ()
const;
126 nonvirtual optional<String> GetAudience ()
const;
131 nonvirtual optional<DateTime> GetExpirationTime ()
const;
136 nonvirtual optional<DateTime> GetNotBefore ()
const;
142 nonvirtual optional<Range<DateTime>>
GetValidFor ()
const;
147 nonvirtual optional<DateTime> GetIssuedAt ()
const;
152 nonvirtual optional<String> GetJWTID ()
const;
157 nonvirtual
String ToString ()
const;
String is like std::u32string, except it is much easier to use, often much more space efficient,...
JSON Web Token - a cryptographically signed set of claims - see https://datatracker....
JWT(const JWT &)=default
construct a JWT from an encoded string. If fullyValidate true, also validate the signature (NYI)
nonvirtual Mapping< String, String > GetPayloadClaims() const
this is probably what you want to look at
nonvirtual optional< Range< DateTime > > GetValidFor() const
combined exp and nbf, to produce a datetime range the token is to be considered valid
constexpr string_view kIssuedAt
The "iat" (issued at) claim identifies the time at which the JWT was issued.
constexpr string_view kSubject
The "sub" (subject) claim identifies the principal that is the subject of the JWT.
constexpr string_view kExpirationTime
The "exp" (expiration time) claim identifies the expiration time on or after which the JWT MUST NOT b...
constexpr string_view kAudience
The "aud" (audience) claim identifies the recipients that the JWT is intended for.
constexpr string_view kIssuer
The "iss" (issuer) claim identifies the principal that issued the JWT.
constexpr string_view kJWTID
The "jti" (JWT ID) claim provides a unique identifier for the JWT.
constexpr string_view kNotBefore
The "nbf" (not before) claim identifies the time before which the JWT MUST NOT be accepted for proces...