Package org.appng.api.auth
Interface PasswordPolicy
-
- All Known Implementing Classes:
ConfigurablePasswordPolicy
public interface PasswordPolicy
APasswordPolicy
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
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
PasswordPolicy.ValidationResult
Holds the result of validating a password.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
configure(Properties platformProperties)
Configures thePasswordPolicy
String
generatePassword()
Generates a new random password that matches the requirements and returns it.default PasswordPolicy.ValidationResult
validatePassword(String username, char[] currentPassword, char[] password)
Validates the password an returns aPasswordPolicy.ValidationResult
-
-
-
Field Detail
-
NUMBER
static final String NUMBER
numbers 0-9- See Also:
- Constant Field Values
-
LOWERCASE
static final String LOWERCASE
lowercase letters a-z- See Also:
- Constant Field Values
-
UPPERCASE
static final String UPPERCASE
uppercase letters A-Z- See Also:
- Constant Field Values
-
PUNCT
static final String PUNCT
punctuation characters !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~- See Also:
- Constant Field Values
-
-
Method Detail
-
configure
default void configure(Properties platformProperties)
Configures thePasswordPolicy
- Parameters:
platformProperties
- the platform'sProperties
- Since:
- 1.21
-
validatePassword
default PasswordPolicy.ValidationResult validatePassword(String username, char[] currentPassword, char[] password)
Validates the password an returns aPasswordPolicy.ValidationResult
- Parameters:
username
- the username (can benull
)currentPassword
- the current password (can benull
)password
- the new password (must not benull
)- Returns:
- the validation result
-
generatePassword
String generatePassword()
Generates a new random password that matches the requirements and returns it.- Returns:
- the randomly generated password
-
-