Class DefaultAuthPasswordManager

java.lang.Object
com.axelor.auth.password.DefaultAuthPasswordManager
All Implemented Interfaces:
AuthPasswordManager

@Singleton public class DefaultAuthPasswordManager extends Object implements AuthPasswordManager
Default implementation of AuthPasswordManager.
  • Constructor Details

    • DefaultAuthPasswordManager

      @Inject public DefaultAuthPasswordManager(Set<PasswordPolicy> policies)
  • Method Details

    • validate

      public InvalidPolicy validate(String password, @Nullable User user)
      Description copied from interface: AuthPasswordManager
      Validates the given password against all registered policies.

      Policies are checked in sequence and stop at the first violation.

      Specified by:
      validate in interface AuthPasswordManager
      Parameters:
      password - the plain-text password to validate
      user - the user for context-aware checks, or null for new users
      Returns:
      an InvalidPolicy describing the first violated policy, or null if all policies pass
    • getDescriptions

      public List<PolicyDescription> getDescriptions()
      Description copied from interface: AuthPasswordManager
      Returns the descriptions of all currently enabled policies, in evaluation order. Policies that return null from PasswordPolicy.getDescription() are excluded.

      The resulting list is intended to be displayed as guidance on the login or change-password page, before the user submits a new password.

      Specified by:
      getDescriptions in interface AuthPasswordManager
      Returns:
      an ordered list of policy descriptions