Class SimplePasswordPolicy<A extends LoginCredentials>

java.lang.Object
io.inverno.mod.security.authentication.password.SimplePasswordPolicy<A>
Type Parameters:
A - the login credentials type
All Implemented Interfaces:
PasswordPolicy<A,SimplePasswordPolicy.SimplePasswordStrength>

public class SimplePasswordPolicy<A extends LoginCredentials> extends Object implements PasswordPolicy<A,SimplePasswordPolicy.SimplePasswordStrength>

A simple password policy that simply checks for password's length.

Following latest NIST Digital Identity Guidelines Section 5.1.1.2, a password should be at least 8 characters and at most 64 characters long. Please refer to these guidelines in order to build more robust password policies (dictionary words, repetitive or sequential characters, context-specific words...).

Since:
1.5
Author:
Jeremy Kuhn
  • Field Details

    • DEFAULT_MINIMUM_PASSWORD_LENGTH

      public static final int DEFAULT_MINIMUM_PASSWORD_LENGTH
      The default minimum password length.
      See Also:
    • DEFAULT_MAXIMUM_PASSWORD_LENGTH

      public static final int DEFAULT_MAXIMUM_PASSWORD_LENGTH
      The default maximum password length.
      See Also:
  • Constructor Details

    • SimplePasswordPolicy

      public SimplePasswordPolicy()

      Creates a default simple password policy.

    • SimplePasswordPolicy

      public SimplePasswordPolicy(int minimumPasswordLength, int maximumPasswordLength) throws IllegalArgumentException

      Creates a simple password policy with the specified password lengths.

      Parameters:
      minimumPasswordLength - the minimum password length
      maximumPasswordLength - the maximum password length
      Throws:
      IllegalArgumentException - if specified parameters are incorrect
  • Method Details