|
10Duke Enterprise C++ SDK
|
#include <OAuthTokenResponse.h>
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. | |
| std::int64_t | getExpiresAtOrDoesNotExpire () const |
| Returns the expiration time for the access token state. | |
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::JSONObject > | additionalProperties |
| 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. | |
|
inline |
Constructs new instance.
| accessToken | - |
| refreshToken | - |
| expiresAt | - |
| additionalProperties | - |
|
inline |
Returns the expiration time for the access token state.
expires_in is only RECOMMENDED (RFC 6749, section 5.1), and if it is missing, the lifetime of the token is not known. In this case the token is considered not to expire, and the application relies on the server rejecting the expired token.
| 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.
| const std::string tenduke::oauth::OAuthTokenResponse::refreshToken |
Refresh token.
Will be .empty() if the response did not contain "refresh_token"-property.