Wt  3.3.8
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
AbstractUserDatabase

Constructor & Destructor Documentation

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

Default constructor.

Creates an invalid token.

See also
checkValid()
Wt::Auth::IssuedToken::IssuedToken ( const std::string &  id,
const AbstractUserDatabase userDatabase 
)

Constructor.

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

Member Function Documentation

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.

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
AbstractUserDatabase

Generated on Mon Sep 4 2017 for the C++ Web Toolkit (Wt) by doxygen 1.8.11