Wt: Wt::Auth::Identity Class Reference

Wt 3.3.0

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

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Attributes
Wt::Auth::Identity Class Reference
Authentication module (Wt::Auth)

A class that represents a user identity. More...

`#include <Auth/Identity>`

List of all members.

## Public Member Functions
| Identity ()
| Default constructor.
| Identity (const std::string &provider, const std::string &id, const WString &name, const std::string &email, bool emailVerified)
| Constructor.
bool | isValid () const
| Returns whether the identity is valid.
const std::string & | provider () const
| Returns the provider name.
const std::string & | id () const
| Returns the id.
const WString & | name () const
| Returns the name.
const std::string & | email () const
| Returns an email address.
bool | emailVerified () const
| Returns whether the email address has been verified.
## Static Public Attributes
static const Identity | Invalid
| An invalid identity constant.
static const std::string | LoginName = "loginname"
| The login name identity.

## Detailed Description

A class that represents a user identity.

The identity is the result of an authentication process. Although the most common authentication method (password authentication) only returns a user name, other methods (such as OAuth, client SSL certificates, or an authentication reverse proxy server) may return more information.

At the very least, the user is identified using a unique ID, and it optionally also contains name and email address information.

See also:
  OAuthService::getIdentity(), RegistrationWidget::registerIdentified()

## Constructor & Destructor Documentation

Wt::Auth::Identity::Identity | ( |  | ) |

Default constructor.

Creates an invalid identity.

## Member Function Documentation

const std::string& Wt::Auth::Identity::email | ( |  | ) | const

Returns an email address.

Returns the user's email address, or an empty string if not provided.

See also:
  emailVerified()

bool Wt::Auth::Identity::emailVerified | ( |  | ) | const

Returns whether the email address has been verified.

The third party provider may be able to guarantee that the user indeed also control's the given email address (e.g. because the third party hosts that email account for the user).

See also:
  email()

const std::string& Wt::Auth::Identity::id | ( |  | ) | const

Returns the id.

Returns a unique identifier for the user within the scope of this provider.

bool Wt::Auth::Identity::isValid | ( |  | ) | const

Returns whether the identity is valid.

An invalid identity is used to indicate for example that no identity information could be obtained.

const WString& Wt::Auth::Identity::name | ( |  | ) | const

Returns the name.

Returns the user's name, or an empty string if not provided.

const std::string& Wt::Auth::Identity::provider | ( |  | ) | const

Returns the provider name.

This is a unique id that names the source for this identity (e.g. "google-oauth", or "LDAP", or "user" (for a user-chosen identity).

## Member Data Documentation

const Identity Wt::Auth::Identity::Invalid`[static]`

An invalid identity constant.

This is an identity that is not isValid().

const std::string Wt::Auth::Identity::LoginName = "loginname"`[static]`

The login name identity.

This is a provider name for the (usually user-controlled) identity, used for example for password-based authentication.

All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator