olp-cpp-sdk  1.18.1
Public Member Functions | List of all members
olp::client::OauthToken Class Reference

A parsed response received from the OAuth2.0 token endpoint. More...

#include <OauthToken.h>

Public Member Functions

 OauthToken (std::string access_token, time_t expiry_time)
 Creates the OauthToken instance. More...
 
 OauthToken (std::string access_token, std::chrono::seconds expires_in)
 Creates the OauthToken instance. More...
 
 OauthToken ()=default
 Creates the default OauthToken instance.
 
const std::string & GetAccessToken () const
 Gets the access token issued by the authorization server. More...
 
time_t GetExpiryTime () const
 Gets the Epoch time when the token expires. More...
 
std::chrono::seconds GetExpiresIn () const
 Gets the number of seconds the token is still valid for. More...
 

Detailed Description

A parsed response received from the OAuth2.0 token endpoint.

You can get the following information: the access token issued by the authorization server ( GetAccessToken ) and its expiry time ( GetExpiryTime ).

Constructor & Destructor Documentation

◆ OauthToken() [1/2]

olp::client::OauthToken::OauthToken ( std::string  access_token,
time_t  expiry_time 
)

Creates the OauthToken instance.

Parameters
access_tokenThe access token issued by the authorization server.
expiry_timeThe Epoch time when the token expires.

◆ OauthToken() [2/2]

olp::client::OauthToken::OauthToken ( std::string  access_token,
std::chrono::seconds  expires_in 
)

Creates the OauthToken instance.

Parameters
access_tokenThe access token issued by the authorization server.
expires_inThe expiry time of the access token.

Member Function Documentation

◆ GetAccessToken()

const std::string& olp::client::OauthToken::GetAccessToken ( ) const

Gets the access token issued by the authorization server.

Returns
The access token issued by the authorization server.

◆ GetExpiresIn()

std::chrono::seconds olp::client::OauthToken::GetExpiresIn ( ) const

Gets the number of seconds the token is still valid for.

Returns
The number of seconds the token is still valid for.

◆ GetExpiryTime()

time_t olp::client::OauthToken::GetExpiryTime ( ) const

Gets the Epoch time when the token expires.

Returns
The Epoch time when the token expires.

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