Wt  4.0.2
Public Member Functions | Static Public Attributes | List of all members
Wt::Auth::OAuthAccessToken Class Reference

An OAuth access token. More...

#include <Wt/Auth/OAuthService.h>

Public Member Functions

 OAuthAccessToken ()
 Default constructor. More...
 OAuthAccessToken (const std::string &value, const WDateTime &expires, const std::string &refreshToken)
 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...

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

An invalid token constant.

This is a token that is not isValid().

Generated on Fri Nov 24 2017 for the C++ Web Toolkit (Wt) by doxygen 1.8.11