Wt  3.3.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | Static Public Attributes
Wt::Auth::FormBaseModel Class Reference

A base model class for authentication-related forms. More...

#include <Wt/Auth/FormBaseModel>

Inheritance diagram for Wt::Auth::FormBaseModel:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 FormBaseModel (const AuthService &baseAuth, AbstractUserDatabase &users, WObject *parent=0)
 Constructor.
const AuthServicebaseAuth () const
 Returns the authentication base service.
AbstractUserDatabaseusers ()
 Returns the user database.
virtual void addPasswordAuth (const AbstractPasswordService *auth)
 Adds a password authentication service.
const AbstractPasswordServicepasswordAuth () const
 Returns the password authentication service.
virtual void addOAuth (const OAuthService *auth)
 Adds an OAuth authentication service provider.
virtual void addOAuth (const std::vector< const OAuthService * > &auth)
 Adds a list of OAuth authentication service providers.
std::vector< const OAuthService * > oAuth () const
 Returns the list of OAuth authentication service providers.
virtual WString label (Field field) const
 Returns a field label.
virtual bool loginUser (Login &login, User &user, LoginState state=StrongLogin)
 Logs the user in.

Static Public Attributes

static const Field LoginNameField = "user-name"
 Login name field.

Detailed Description

A base model class for authentication-related forms.

This class manages the the auth services and the user database which an authentication model will use to implement a form..


Member Function Documentation

void Wt::Auth::FormBaseModel::addOAuth ( const OAuthService auth) [virtual]

Adds an OAuth authentication service provider.

This enables OAuth-based registration. More than one OAuth authentication service can be configured: one for each supported third-party OAuth identity provider.

See also:
addPasswordAuth()
void Wt::Auth::FormBaseModel::addOAuth ( const std::vector< const OAuthService * > &  auth) [virtual]

Adds a list of OAuth authentication service providers.

See also:
addOAuth()

Adds a password authentication service.

This enables password-based registration, including choosing a proper password.

Only one password authentication service can be configured.

See also:
addOAuth()
AbstractPasswordService::validatePassword()

Returns the authentication base service.

This returns the service passed through the constructor.

WString Wt::Auth::FormBaseModel::label ( Field  field) const [virtual]

Returns a field label.

The default implementation returns the WString::tr(field)

Reimplemented from Wt::WFormModel.

bool Wt::Auth::FormBaseModel::loginUser ( Login login,
User user,
LoginState  state = StrongLogin 
) [virtual]

Logs the user in.

Logs in the user, after checking whether the user can actually be logged in. A valid user may be refused to login if its account is disabled (see User::status()) or if it's email address is unconfirmed and email confirmation is required.

Returns whether the user could be logged in.

std::vector<const OAuthService *> Wt::Auth::FormBaseModel::oAuth ( ) const

Returns the list of OAuth authentication service providers.

See also:
addOAuth()

Returns the password authentication service.

See also:
addPasswordAuth()
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator

Generated on Tue Mar 22 2016 for the C++ Web Toolkit (Wt) by doxygen 1.7.6.1