Wt
3.7.1
|
An OAuth access token. More...
#include <Wt/Auth/OAuthService>
Public Member Functions | |
OAuthAccessToken () | |
Default constructor. More... | |
OAuthAccessToken (const std::string &value, const WDateTime &expires, const std::string &refreshToken) | |
Constructor. | |
OAuthAccessToken (const std::string &value, const WDateTime &expires, const std::string &refreshToken, const std::string &idToken) | |
Constructor with an OpenID Connect ID token. | |
bool | isValid () const |
Returns whether the token is valid. More... | |
const std::string & | value () const |
Returns the access token value. More... | |
WDateTime | expires () const |
Returns the token expires time (if available). More... | |
const std::string & | refreshToken () const |
Returns the refresh token (if available). More... | |
Static Public Attributes | |
static const OAuthAccessToken | Invalid |
An invalid token constant. More... | |
An OAuth access token.
A access token is the result of an authorization process, and encapsulates the authorization to access protected information.
Next to its value(), it also contains optionally an expires date and a refresh token.
Wt::Auth::OAuthAccessToken::OAuthAccessToken | ( | ) |
Default constructor.
Creates an invalid access token.
WDateTime Wt::Auth::OAuthAccessToken::expires | ( | ) | const |
Returns the token expires time (if available).
Returns a Null date-time if not available.
bool Wt::Auth::OAuthAccessToken::isValid | ( | ) | const |
Returns whether the token is valid.
An invalid access token is used to signal for example that the user denied the authorization request.
const std::string& Wt::Auth::OAuthAccessToken::refreshToken | ( | ) | const |
Returns the refresh token (if available).
The refresh token is an optional token that can be used when the access token has expired.
If not available, returns an empty string.
const std::string& Wt::Auth::OAuthAccessToken::value | ( | ) | const |
Returns the access token value.
This value can be used to access protected resources.
|
static |
An invalid token constant.
This is a token that is not isValid().