Wt  3.2.0
Public Member Functions
Wt::Auth::AbstractPasswordService::AbstractStrengthValidator Class Reference

Validator for password strength. More...

Inheritance diagram for Wt::Auth::AbstractPasswordService::AbstractStrengthValidator:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual int evaluateStrength (const WString &password, const WString &loginName, const std::string &email) const =0
 Evaluates the strength of a password.
virtual bool isValid (int result) const =0
 Returns whether the password is considered strong enough.
virtual WString message (int result) const =0
 Returns a message describing a password strength.
virtual int strength (int result) const
 Returns the password strength in a scale of 0 to 5.
virtual Result validate (const WString &password, const WString &loginName, const std::string &email) const
 Validates a password.
virtual Result validate (const WString &password) const
 Validates a password.

Detailed Description

Validator for password strength.

This class defines a specialized validator interface for evaluating password strength. The implementation allows to evaluate strength on a numeric scale (from 0 to 5) in addition to the normal validator functionality of validating a password.

The actual computation is done by validateStrength(), which returns an opaque number that is interpreted with isValid(), message() and strength() methods.

See also:
strengthValidator()

Member Function Documentation

virtual int Wt::Auth::AbstractPasswordService::AbstractStrengthValidator::evaluateStrength ( const WString password,
const WString loginName,
const std::string &  email 
) const [pure virtual]

Evaluates the strength of a password.

The result is an opaque number which is interpreted by isValid(), message() and strength().

The validator may take into account the user's login name and email address, to exclude passwords that are too similar to these.

Implemented in Wt::Auth::PasswordStrengthValidator.

virtual bool Wt::Auth::AbstractPasswordService::AbstractStrengthValidator::isValid ( int  result) const [pure virtual]

Returns whether the password is considered strong enough.

This is used by validate() to return the validation state.

Implemented in Wt::Auth::PasswordStrengthValidator.

virtual WString Wt::Auth::AbstractPasswordService::AbstractStrengthValidator::message ( int  result) const [pure virtual]

Returns a message describing a password strength.

When the password is not strong enough, this should return a message which helps the user pick a stronger password.

Implemented in Wt::Auth::PasswordStrengthValidator.

int Wt::Auth::PasswordService::AbstractStrengthValidator::strength ( int  result) const [virtual]

Returns the password strength in a scale of 0 to 5.

The default implementation simply returns 5 for a valid, and 0 for an invalid password.

Note:
This is currently not used.
WValidator::Result Wt::Auth::PasswordService::AbstractStrengthValidator::validate ( const WString password,
const WString loginName,
const std::string &  email 
) const [virtual]

Validates a password.

This uses evaluateStrength(), isValid() and message() to return the result of password validation.

WValidator::Result Wt::Auth::PasswordService::AbstractStrengthValidator::validate ( const WString password) const [virtual]

Validates a password.

Calls validate(password, WString::Empty, "");

Reimplemented from Wt::WValidator.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator

Generated on Tue Nov 29 2011 for the C++ Web Toolkit (Wt) by doxygen 1.7.5.1