Class AbstractPasswordService.AbstractStrengthValidator

java.lang.Object
eu.webtoolkit.jwt.WObject
eu.webtoolkit.jwt.WValidator
eu.webtoolkit.jwt.auth.AbstractPasswordService.AbstractStrengthValidator
Direct Known Subclasses:
PasswordStrengthValidator
Enclosing interface:
AbstractPasswordService

public abstract static class AbstractPasswordService.AbstractStrengthValidator
extends WValidator
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.

See Also:
AbstractPasswordService.getStrengthValidator()
  • Constructor Details

    • AbstractStrengthValidator

      public AbstractStrengthValidator()
      Constructor.
  • Method Details

    • evaluateStrength

      public abstract AbstractPasswordService.StrengthValidatorResult evaluateStrength​(java.lang.String password, java.lang.String loginName, java.lang.String email)
      Evaluates the strength of a password.

      The result is an instance of AbstractPasswordService.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.

    • validate

      public WValidator.Result validate​(java.lang.String password, java.lang.String loginName, java.lang.String email)
      Validates a password.

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

    • validate

      public WValidator.Result validate​(java.lang.String password)
      Validates a password.

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

      Overrides:
      validate in class WValidator