Package org.opends.server.extensions
Class CharacterSetPasswordValidator
- java.lang.Object
-
- org.opends.server.api.PasswordValidator<CharacterSetPasswordValidatorCfg>
-
- org.opends.server.extensions.CharacterSetPasswordValidator
-
- All Implemented Interfaces:
ConfigurationChangeListener<CharacterSetPasswordValidatorCfg>
public final class CharacterSetPasswordValidator extends PasswordValidator<CharacterSetPasswordValidatorCfg> implements ConfigurationChangeListener<CharacterSetPasswordValidatorCfg>
This class provides an OpenDJ password validator that may be used to ensure that proposed passwords contain at least a specified number of characters from one or more user-defined character sets.
-
-
Constructor Summary
Constructors Constructor Description CharacterSetPasswordValidator()
Creates a new instance of this character set password validator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConfigChangeResult
applyConfigurationChange(CharacterSetPasswordValidatorCfg configuration)
Applies the configuration changes to this change listener.com.forgerock.opendj.ldap.controls.PasswordQualityAdviceResponseControl.Criteria
createPasswordQualityCriteria()
Returns a password quality criteria corresponding to the type and parameters of this validator for use in aPasswordQualityAdviceResponseControl
.void
finalizePasswordValidator()
Performs any finalization that might be required when this password validator is unloaded.void
initializePasswordValidator(CharacterSetPasswordValidatorCfg configuration)
Initializes this password validator based on the information in the provided configuration entry.boolean
isConfigurationAcceptable(CharacterSetPasswordValidatorCfg configuration, List<LocalizableMessage> unacceptableReasons)
Indicates whether the provided configuration is acceptable for this password validator.boolean
isConfigurationChangeAcceptable(CharacterSetPasswordValidatorCfg configuration, List<LocalizableMessage> unacceptableReasons)
Indicates whether the proposed change to the configuration is acceptable to this change listener.boolean
passwordIsAcceptable(ByteString newPassword, Set<ByteString> currentPasswords, Operation operation, Entry userEntry, LocalizableMessageBuilder invalidReason)
Indicates whether the provided password is acceptable for use by the specified user.
-
-
-
Method Detail
-
initializePasswordValidator
public void initializePasswordValidator(CharacterSetPasswordValidatorCfg configuration) throws ConfigException
Description copied from class:PasswordValidator
Initializes this password validator based on the information in the provided configuration entry.- Specified by:
initializePasswordValidator
in classPasswordValidator<CharacterSetPasswordValidatorCfg>
- Parameters:
configuration
- The configuration to use to initialize this password validator.- Throws:
ConfigException
- If an unrecoverable problem arises in the process of performing the initialization.
-
finalizePasswordValidator
public void finalizePasswordValidator()
Description copied from class:PasswordValidator
Performs any finalization that might be required when this password validator is unloaded. No action is taken in the default implementation.- Overrides:
finalizePasswordValidator
in classPasswordValidator<CharacterSetPasswordValidatorCfg>
-
passwordIsAcceptable
public boolean passwordIsAcceptable(ByteString newPassword, Set<ByteString> currentPasswords, Operation operation, Entry userEntry, LocalizableMessageBuilder invalidReason)
Description copied from class:PasswordValidator
Indicates whether the provided password is acceptable for use by the specified user. If the password is determined to be unacceptable, then a human-readable explanation should be appended to the provided buffer.- Specified by:
passwordIsAcceptable
in classPasswordValidator<CharacterSetPasswordValidatorCfg>
- Parameters:
newPassword
- The proposed clear-text password that should be validated.currentPasswords
- The set of clear-text current passwords for the user (if available). Note that the current passwords may not always be available, and this may not comprise entire set of passwords currently for the user.operation
- The operation that is being used to set the password. It may be an add, a modify, or a password modify operation.userEntry
- The entry for the user whose password is being changed.invalidReason
- The buffer to which the human-readable explanation should be appended if it is determined that the password is not acceptable.- Returns:
true
if the password is acceptable, orfalse
if not.
-
isConfigurationAcceptable
public boolean isConfigurationAcceptable(CharacterSetPasswordValidatorCfg configuration, List<LocalizableMessage> unacceptableReasons)
Description copied from class:PasswordValidator
Indicates whether the provided configuration is acceptable for this password validator. It should be possible to call this method on an uninitialized password validator instance in order to determine whether the password validator would be able to use the provided configuration.- Overrides:
isConfigurationAcceptable
in classPasswordValidator<CharacterSetPasswordValidatorCfg>
- Parameters:
configuration
- The password validator configuration for which to make the determination.unacceptableReasons
- A list that may be used to hold the reasons that the provided configuration is not acceptable.- Returns:
true
if the provided configuration is acceptable for this password validator, orfalse
if not.
-
isConfigurationChangeAcceptable
public boolean isConfigurationChangeAcceptable(CharacterSetPasswordValidatorCfg configuration, List<LocalizableMessage> unacceptableReasons)
Description copied from interface:ConfigurationChangeListener
Indicates whether the proposed change to the configuration is acceptable to this change listener.- Specified by:
isConfigurationChangeAcceptable
in interfaceConfigurationChangeListener<CharacterSetPasswordValidatorCfg>
- Parameters:
configuration
- The new configuration containing the changes.unacceptableReasons
- A list that can be used to hold messages about why the provided configuration is not acceptable.- Returns:
- Returns
true
if the proposed change is acceptable, orfalse
if it is not.
-
applyConfigurationChange
public ConfigChangeResult applyConfigurationChange(CharacterSetPasswordValidatorCfg configuration)
Description copied from interface:ConfigurationChangeListener
Applies the configuration changes to this change listener.- Specified by:
applyConfigurationChange
in interfaceConfigurationChangeListener<CharacterSetPasswordValidatorCfg>
- Parameters:
configuration
- The new configuration containing the changes.- Returns:
- Returns information about the result of changing the configuration.
-
createPasswordQualityCriteria
public com.forgerock.opendj.ldap.controls.PasswordQualityAdviceResponseControl.Criteria createPasswordQualityCriteria()
Description copied from class:PasswordValidator
Returns a password quality criteria corresponding to the type and parameters of this validator for use in aPasswordQualityAdviceResponseControl
.- Specified by:
createPasswordQualityCriteria
in classPasswordValidator<CharacterSetPasswordValidatorCfg>
- Returns:
- A password quality criteria corresponding to the type and parameters of this validator.
-
-