Wt
3.2.3
|
Validator for password strength. More...
Public Member Functions | |
virtual StrengthValidatorResult | evaluateStrength (const WString &password, const WString &loginName, const std::string &email) const =0 |
Evaluates the strength of a password. | |
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. |
Validator for password strength.
This class defines a specialized validator interface for evaluating password strength. The implementation allows to evaluate strength in addition to the normal validator functionality of validating a password.
The evaluateStrength() computes the strength and returns an instance of StrenghtValidatorResult which contains information on the validity and the strength of the password together with possible messages.
virtual StrengthValidatorResult Wt::Auth::AbstractPasswordService::AbstractStrengthValidator::evaluateStrength | ( | const WString & | password, |
const WString & | loginName, | ||
const std::string & | |||
) | const [pure virtual] |
Evaluates the strength of a password.
The result is an instance of StrengthValidatorResult which contains information on the validity and the strength of the password together with possible messages.
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.
WValidator::Result Wt::Auth::AbstractPasswordService::AbstractStrengthValidator::validate | ( | const WString & | password, |
const WString & | loginName, | ||
const std::string & | |||
) | const [virtual] |
Validates a password.
This uses evaluateStrength(), isValid() and message() to return the result of password validation.
WValidator::Result Wt::Auth::AbstractPasswordService::AbstractStrengthValidator::validate | ( | const WString & | password | ) | const [virtual] |
Validates a password.
Calls validate(password, WString::Empty, "");
Reimplemented from Wt::WValidator.