Wt: Wt::Auth::AuthTokenResult Class Reference

Wt 3.3.0

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

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions
Wt::Auth::AuthTokenResult Class Reference
Authentication module (Wt::Auth)

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

`#include <Wt/Auth/AuthService>`

List of all members.

## Public Types
enum | Result { Invalid, Valid }
| Enumeration that describes the result. More...
## Public Member Functions
| AuthTokenResult (Result result, const User &user=User(), const std::string &newToken=std::string())
| Constructor.
Result | result () const
| Returns the result.
const User & | user () const
| Returns the identified user.
std::string | newToken () const
| Returns a new token for this user.

## 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()

## Member Enumeration Documentation

enum Wt::Auth::AuthTokenResult::Result

Enumeration that describes the result.

Enumerator:

  Invalid | The presented auth token could be used to identify a user.
  Valid | The presented auth token was invalid.

## Constructor & Destructor Documentation

Wt::Auth::AuthTokenResult::AuthTokenResult | ( | Result | result,
|  | const User & | user = `User()`,
|  | const std::string & | newToken = `std::string()`
| ) |  |

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 result() == Valid.

const User & Wt::Auth::AuthTokenResult::user | ( |  | ) | const

Returns the identified user.

The user is valid only if the the result() == Valid.

All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator