|
cesium-native 0.56.0
|
A login token for interacting with the Cesium ion REST API, obtained from the OAuth authentication flow. More...
#include <CesiumIonClient/LoginToken.h>
Public Member Functions | |
| bool | isValid () const |
| Returns whether this token is currently valid. | |
| std::optional< std::time_t > | getExpirationTime () const |
| Returns the time that this token expires, represented as a number of seconds since the Unix epoch. | |
| const std::string & | getToken () const |
| Returns the contained token string. | |
| LoginToken (const std::string &token, const std::optional< std::time_t > &expirationTime) | |
Creates a new LoginToken. | |
Static Public Member Functions | |
| static CesiumUtility::Result< LoginToken > | parse (const std::string &tokenString) |
| Creates a new LoginToken by parsing the provided JWT authentication token. | |
A login token for interacting with the Cesium ion REST API, obtained from the OAuth authentication flow.
These tokens have a limited duration and are scoped to a user's account. This is distinct from a Cesium ion Token, which is valid until revoked by the user and is scoped to specific assets and endpoints.
Definition at line 21 of file LoginToken.h.
| CesiumIonClient::LoginToken::LoginToken | ( | const std::string & | token, |
| const std::optional< std::time_t > & | expirationTime ) |
Creates a new LoginToken.
| token | The full token string. |
| expirationTime | A UNIX timestamp representing the point in time that this token stops being valid. If this parameter is std::nullopt, the token is assumed to never expire. |
| std::optional< std::time_t > CesiumIonClient::LoginToken::getExpirationTime | ( | ) | const |
Returns the time that this token expires, represented as a number of seconds since the Unix epoch.
If the token does not expire, this method returns std::nullopt.
| bool CesiumIonClient::LoginToken::isValid | ( | ) | const |
Returns whether this token is currently valid.
The token is valid up until its expiration time. If the token does not have an expiration time, this method returns true.
|
static |
Creates a new LoginToken by parsing the provided JWT authentication token.
| tokenString | The JWT authentication token. |
Result containing either the parsed LoginToken or error messages.