Wt: Wt::Auth::OAuthAccessToken Class Reference

Wt 3.3.0

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Attributes
Wt::Auth::OAuthAccessToken Class Reference
Authentication module (Wt::Auth)

An OAuth access token. More...

`#include <Wt/Auth/OAuthService>`

List of all members.

## Public Member Functions
| OAuthAccessToken ()
| Default constructor.
| OAuthAccessToken (const std::string &value, const WDateTime &expires, const std::string &refreshToken)
| Constructor.
bool | isValid () const
| Returns whether the token is valid.
const std::string & | value () const
| Returns the access token value.
WDateTime | expires () const
| Returns the token expires time (if available).
const std::string & | refreshToken () const
| Returns the refresh token (if available).
## Static Public Attributes
static const OAuthAccessToken | Invalid
| An invalid token constant.

## Detailed Description

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.

See also:
  OAuthProcess::startAuthorize(), OAuthProcess::authorized()

## Constructor & Destructor Documentation

Wt::Auth::OAuthAccessToken::OAuthAccessToken | ( |  | ) |

Default constructor.

Creates an invalid access token.

## Member Function Documentation

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.

## Member Data Documentation

const OAuthAccessToken Wt::Auth::OAuthAccessToken::Invalid`[static]`

An invalid token constant.

This is a token that is not isValid().

All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator