10Duke Enterprise C++ Client
Loading...
Searching...
No Matches
tenduke::oidc::IdToken Class Reference

#include <IdToken.h>

Detailed Description

OIDC ID-token.

Inheritance diagram for tenduke::oidc::IdToken:
tenduke::jwt::JWT

Public Member Functions

 IdToken (std::string serialized, const std::map< std::string, std::string > &claims, const std::map< std::string, std::string > &headerParameters={}, const std::map< std::string, std::map< std::string, std::string > > &mapClaims={})
 Constructs new IdToken.
 
 IdToken (std::string serialized, const tenduke::jwt::JWT &jwt)
 Constructs new IdToken.
 
const std::string & getNonce () const
 Returns nonce.
 
const std::string & getSerialized () const
 Returns serialized representation of the ID-token.
 
bool isNullToken () const
 Returns true, if token is a "null" token, i.e.
 
- Public Member Functions inherited from tenduke::jwt::JWT
 JWT (std::map< std::string, std::string > claims)
 Constructs new JWT instance from given claims.
 
 JWT (const std::map< std::string, std::string > &claims, const std::map< std::string, std::string > &headerParameters, const std::map< std::string, std::map< std::string, std::string > > &mapClaims={}, const std::map< std::string, std::vector< std::string > > &arrayClaims={})
 Constructs new JWT instance from given claims and header parameters.
 
 JWT (const JWT &copy)=default
 Copy-constructs new JWT instance.
 
bool hasClaim (const std::string &name) const
 Checks if the JWT has given claim.
 
const std::string * claim (const std::string &name) const
 Returns a JWT-claim by given name.
 
const std::map< std::string, std::string > & getClaims () const
 Returns all claims as a map.
 
const std::string & getStringClaim (const std::string &claimName) const
 Returns a claim value as string.
 
std::int64_t getIntClaim (const std::string &claimName) const
 Returns claim value as std::int64_t.
 
const std::string & getJWTID () const
 Returns "JWT ID", "jti"-claim.
 
const std::string & getIssuer () const
 Returns "Issuer", "iss"-claim.
 
const std::string & getSubject () const
 Returns "Subject", "sub"-claim.
 
const std::string & getAudience () const
 Returns "Audience", "aud"-claim.
 
std::int64_t getExpirationTime () const
 Returns "Expiration time", "exp"-claim.
 
std::int64_t getIssuedAt () const
 Returns "Issued at", "iat"-claim.
 
std::string getHeaderParameterKID () const
 Returns header-parameter KeyId ("kid"-parameter).
 
std::map< std::string, std::string > getHeaderParameters () const
 Returns header parameters.
 
std::map< std::string, std::string > getMapClaim (const std::string &name) const
 Returns a claim, which is a map.
 
std::vector< std::string > getArrayClaim (const std::string &name) const
 Returns a claim, which is a JSON array, as vector of strings.
 
bool isInfinite () const
 Returns true if token does expire.
 

Static Public Member Functions

static IdToken null ()
 Returns "null" token token indicate that ID-token does not exist.
 

Additional Inherited Members

- Static Public Attributes inherited from tenduke::jwt::JWT
static const std::int64_t NUMBER_NOT_PRESENT = INT64_MIN
 Magic value to indicate that numeric claim is not present.
 
- Protected Attributes inherited from tenduke::jwt::JWT
std::map< std::string, std::string > claims
 Claims.
 
std::map< std::string, std::string > headerParameters
 Header parameters.
 
std::map< std::string, std::map< std::string, std::string > > mapClaims
 Claims with values of maps.
 
std::map< std::string, std::vector< std::string > > arrayClaims
 Claims with values of arrays.
 

Constructor & Destructor Documentation

◆ IdToken() [1/2]

tenduke::oidc::IdToken::IdToken ( std::string  serialized,
const std::map< std::string, std::string > &  claims,
const std::map< std::string, std::string > &  headerParameters = {},
const std::map< std::string, std::map< std::string, std::string > > &  mapClaims = {} 
)

Constructs new IdToken.

Parameters
serializedthe serialized ID-token
claims-
headerParameters-

◆ IdToken() [2/2]

tenduke::oidc::IdToken::IdToken ( std::string  serialized,
const tenduke::jwt::JWT jwt 
)

Constructs new IdToken.

Parameters
serialized-
jwt-

Member Function Documentation

◆ getNonce()

const std::string & tenduke::oidc::IdToken::getNonce ( ) const

Returns nonce.

Returns
-

◆ getSerialized()

const std::string & tenduke::oidc::IdToken::getSerialized ( ) const

Returns serialized representation of the ID-token.

Returns
-

◆ isNullToken()

bool tenduke::oidc::IdToken::isNullToken ( ) const

Returns true, if token is a "null" token, i.e.

it is a placeholder to indicate that the ID-token does not exist.

Returns
-

◆ null()

IdToken tenduke::oidc::IdToken::null ( )
static

Returns "null" token token indicate that ID-token does not exist.

Returns
-

The documentation for this class was generated from the following files: