10Duke Scale C++ Client
Loading...
Searching...
No Matches
tenduke::oauth::OAuthTokenResponse Class Reference

#include <OAuthTokenResponse.h>

Detailed Description

Encapsulates results from tenduke::oauth::OAuthTokenRequest.

Public Member Functions

 OAuthTokenResponse (std::string accessToken, std::string refreshToken, const std::int64_t expiresAt, std::shared_ptr< tenduke::json::JSONObject > additionalProperties)
 Constructs new instance.
 

Public Attributes

const std::string accessToken
 OAuth access token.
 
const std::string refreshToken
 Refresh token.
 
const std::int64_t expiresAt
 Time (epoch seconds) when the access token expires.
 
std::shared_ptr< tenduke::json::JSONObjectadditionalProperties
 Additional response properties.
 

Static Public Attributes

static const std::int64_t NO_EXPIRES_IN = -1
 Magic value to indicate that the response did not contain expires_in.
 

Constructor & Destructor Documentation

◆ OAuthTokenResponse()

tenduke::oauth::OAuthTokenResponse::OAuthTokenResponse ( std::string  accessToken,
std::string  refreshToken,
const std::int64_t  expiresAt,
std::shared_ptr< tenduke::json::JSONObject additionalProperties 
)
inline

Constructs new instance.

Parameters
accessToken-
refreshToken-
expiresAt-
additionalProperties-

Member Data Documentation

◆ expiresAt

const std::int64_t tenduke::oauth::OAuthTokenResponse::expiresAt

Time (epoch seconds) when the access token expires.

Expires will be NO_EXPIRES_IN if the response did not contain "expires_in"-property.

NOTE: We store expires_at, not expires_in. The value of expires_in is lifetime, which is quite difficult to use as time keeps going on. We typically take current time in epoch seconds and add the expires_in to give us expires_at.

◆ refreshToken

const std::string tenduke::oauth::OAuthTokenResponse::refreshToken

Refresh token.

Will be .empty() if the response did not contain "refresh_token"-property.


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