Wt: Wt::Auth::Token Class Reference

Wt 3.3.0

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

- Class List
- Class Hierarchy
- Class Members

Public Member Functions
Wt::Auth::Token Class Reference
Authentication module (Wt::Auth)

An authentication token hash. More...

`#include <Wt/Auth/Token>`

List of all members.

## Public Member Functions
| Token ()
| Default constructor.
| Token (const std::string &hash, const WDateTime &expirationTime)
| Constructor.
bool | empty () const
| Returns whether the token is empty.
const std::string & | hash () const
| Returns the hash.
const WDateTime & | expirationTime () const
| Returns the expiration time.

## Detailed Description

An authentication token hash.

An authentication token is a surrogate for identification or authentication. When a random authentication token is generated, e.g. using WRandom::generateId() it is a good practice to hash it using a cryptographic hash function, and only save this hash in the session or database for later verification. This avoids that a compromised database would leak all the authentication tokens.

See also:
  User::addAuthToken()
  User::setEmailToken()

## Constructor & Destructor Documentation

Wt::Auth::Token::Token | ( |  | ) |

Default constructor.

Creates an empty token.

## Member Function Documentation

bool Wt::Auth::Token::empty | ( |  | ) | const

Returns whether the token is empty.

An empty token is default constructed.

All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator