Interface PasswordPolicy

  • All Known Implementing Classes:
    ConfigurablePasswordPolicy

    public interface PasswordPolicy
    A PasswordPolicy defines how a valid password looks like, is able to create such a password and to check whether a given character-sequence is a valid password according to the requirements.
    Author:
    Matthias Müller
    • Method Detail

      • configure

        default void configure​(Properties platformProperties)
        Configures the PasswordPolicy
        Parameters:
        platformProperties - the platform's Properties
        Since:
        1.21
      • validatePassword

        default PasswordPolicy.ValidationResult validatePassword​(String username,
                                                                 char[] currentPassword,
                                                                 char[] password)
        Validates the password an returns a PasswordPolicy.ValidationResult
        Parameters:
        username - the username (can be null)
        currentPassword - the current password (can be null)
        password - the new password (must not be null)
        Returns:
        the validation result
      • generatePassword

        String generatePassword()
        Generates a new random password that matches the requirements and returns it.
        Returns:
        the randomly generated password