Wt  3.7.1
Public Member Functions | List of all members
Wt::Auth::IssuedToken Class Reference

Token or authorization code that was issued to a relying party. More...

Public Member Functions

 IssuedToken ()
 Default constructor. More...
 IssuedToken (const std::string &id, const AbstractUserDatabase &userDatabase)
 Constructor. More...
bool checkValid () const
 Returns whether the token is valid. More...
const std::string id () const
 Returns the user id. More...
const std::string value () const
 Retrieves the string value that represents this token, usually random characters.
const WDateTime expirationTime () const
 Retrieves the time when the token expires.
const std::string purpose () const
 Retrieves the purpose of this token: authenication code, access token or refresh token.
const std::string scope () const
 Retrieves the scope of this token as a space-separated string.
const std::string redirectUri () const
 Retrieves the valid redirect uri of this token.
const User user () const
 Retrieves the user that is associated with this token.
const OAuthClient authClient () const
 Retrieves the client for which this token was issued.

Detailed Description

Token or authorization code that was issued to a relying party.

This class represents an access token. It is a value class that stores only the id and a reference to an AbstractUserDatabase to access its properties.

An object can point to a valid token, or be invalid. Invalid tokens are typically used as return value for database queries which did not match with an existing client.

See also

Constructor & Destructor Documentation

◆ IssuedToken() [1/2]

Wt::Auth::IssuedToken::IssuedToken ( )

Default constructor.

Creates an invalid token.

See also

◆ IssuedToken() [2/2]

Wt::Auth::IssuedToken::IssuedToken ( const std::string &  id,
const AbstractUserDatabase userDatabase 


Creates a user with id id, and whose information is stored in the database.

Member Function Documentation

◆ checkValid()

bool Wt::Auth::IssuedToken::checkValid ( ) const

Returns whether the token is valid.

A invalid token is a sentinel value returned by methods that query the database but could not identify a matching user.

◆ id()

const std::string Wt::Auth::IssuedToken::id ( ) const

Returns the user id.

This returns the id that uniquely identifies the token, and acts as a "primary key" to obtain other information for the token in the database.

See also

Generated on Tue Dec 15 2020 for the C++ Web Toolkit (Wt) by doxygen 1.8.13