Wt  4.0.2
Public Types | Public Member Functions | List of all members
Wt::Auth::AuthTokenResult Class Reference

The result of processing an authentication token. More...

#include <Wt/Auth/AuthService.h>

Public Types

typedef AuthTokenState State
 Typedef for enum Wt::Auth::AuthTokenState.
 

Public Member Functions

 AuthTokenResult (AuthTokenState state, const User &user=User(), const std::string &newToken=std::string(), int newTokenValidity=-1)
 Constructor. More...
 
AuthTokenState state () const
 Returns the result.
 
const Useruser () const
 Returns the identified user. More...
 
std::string newToken () const
 Returns a new token for this user. More...
 
int newTokenValidity () const
 Returns the validity of the new token. More...
 

Detailed Description

The result of processing an authentication token.

An authentication token is usually taken from a browser cookie, and used to identify (and possibly authenticate) a user across sessions.

See also
AuthService::processAuthToken()
AuthService::createAuthToken()

Constructor & Destructor Documentation

Wt::Auth::AuthTokenResult::AuthTokenResult ( AuthTokenState  state,
const User user = User(),
const std::string &  newToken = std::string(),
int  newTokenValidity = -1 
)

Constructor.

Creates an authentication token result.

Member Function Documentation

std::string Wt::Auth::AuthTokenResult::newToken ( ) const

Returns a new token for this user.

An authentication token can be used only once, and needs to be replaced by a new token.

The returned token is valid only if the state() == AuthTokenState::Valid.

int Wt::Auth::AuthTokenResult::newTokenValidity ( ) const

Returns the validity of the new token.

This returns the token validity in seconds.

See also
newToken()
const User & Wt::Auth::AuthTokenResult::user ( ) const

Returns the identified user.

The user is valid only if the the state() == AuthTokenState::Valid.


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