Package com.axelor.auth.password.policy
Class DefaultNotSamePasswordPolicy
java.lang.Object
com.axelor.auth.password.policy.DefaultNotSamePasswordPolicy
- All Implemented Interfaces:
PasswordPolicy,NotSamePasswordPolicy
@Singleton
public class DefaultNotSamePasswordPolicy
extends Object
implements NotSamePasswordPolicy
Default implementation of
NotSamePasswordPolicy.-
Field Summary
Fields inherited from interface com.axelor.auth.password.policy.NotSamePasswordPolicy
ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a description of this policy's requirement, suitable for display on the login or change-password page as guidance before the user submits.Checks whether the given password satisfies this policy rule.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.axelor.auth.password.policy.NotSamePasswordPolicy
getPolicyId, isMandatoryMethods inherited from interface com.axelor.auth.password.PasswordPolicy
isEnabledByDefault
-
Constructor Details
-
DefaultNotSamePasswordPolicy
public DefaultNotSamePasswordPolicy()
-
-
Method Details
-
validate
Description copied from interface:PasswordPolicyChecks whether the given password satisfies this policy rule.- Specified by:
validatein interfacePasswordPolicy- Parameters:
user- the user for context-aware checks, ornullfor new userspassword- the plain-text password to check- Returns:
- an
InvalidPolicyif the password violates this rule
-
getDescription
Description copied from interface:PasswordPolicyReturns a description of this policy's requirement, suitable for display on the login or change-password page as guidance before the user submits. This is distinct from the error message returned on violation.Implementations may return
nullwhen the policy has no meaningful description (e.g. a pattern policy with no pattern configured).- Specified by:
getDescriptionin interfacePasswordPolicy- Returns:
- a
PolicyDescription, ornullif not applicable
-