Class PasswordVerificator
- java.lang.Object
-
- pl.edu.icm.unity.engine.api.authn.AbstractVerificator
-
- pl.edu.icm.unity.engine.api.authn.local.AbstractLocalVerificator
-
- pl.edu.icm.unity.stdext.credential.pass.PasswordVerificator
-
- All Implemented Interfaces:
pl.edu.icm.unity.engine.api.authn.CredentialExchange,pl.edu.icm.unity.engine.api.authn.CredentialVerificator,pl.edu.icm.unity.engine.api.authn.local.LocalCredentialVerificator,pl.edu.icm.unity.engine.api.utils.StringConfigurable,PasswordExchange,pl.edu.icm.unity.types.DescribedObject,pl.edu.icm.unity.types.NamedObject
public class PasswordVerificator extends pl.edu.icm.unity.engine.api.authn.local.AbstractLocalVerificator implements PasswordExchange
Ordinary password credential verificator. Supports all settings fromPasswordCredential.Additionally configuration of the credential may allow for password reset feature. Then are stored email verification settings, security question settings and confirmation code length.
- Author:
- K. Benedyczak
- See Also:
PasswordCredential
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPasswordVerificator.Factory
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDESCstatic java.lang.String[]IDENTITY_TYPESstatic java.lang.StringNAME-
Fields inherited from class pl.edu.icm.unity.engine.api.authn.local.AbstractLocalVerificator
credentialName
-
Fields inherited from class pl.edu.icm.unity.engine.api.authn.AbstractVerificator
identityResolver, instanceName
-
Fields inherited from interface pl.edu.icm.unity.stdext.credential.pass.PasswordExchange
ID
-
-
Constructor Summary
Constructors Constructor Description PasswordVerificator(pl.edu.icm.unity.engine.api.notification.NotificationProducer notificationProducer, pl.edu.icm.unity.engine.api.authn.local.CredentialHelper credentialHelper, java.util.Optional<PasswordEncodingPoolProvider> threadPoolProvider)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description pl.edu.icm.unity.types.authn.CredentialPublicInformationcheckCredentialState(java.lang.String currentCredential)pl.edu.icm.unity.engine.api.authn.AuthenticationResultcheckPassword(java.lang.String username, java.lang.String password, java.lang.String formForUnknown, boolean enableAssociation, pl.edu.icm.unity.engine.api.authn.remote.AuthenticationTriggeringContext triggeringContext)Checks if the provided password is valid.static java.util.List<edu.vt.middleware.password.CharacterRule>getCharacteristicsRules()pl.edu.icm.unity.engine.api.authn.CredentialResetgetCredentialResetBackend()static java.util.List<edu.vt.middleware.password.Rule>getSequencesRules()java.lang.StringgetSerializedConfiguration()java.lang.Stringinvalidate(java.lang.String currentCredential)booleanisCredentialDefinitionChagneOutdatingCredentials(java.lang.String newCredentialDefinition)booleanisCredentialSet(pl.edu.icm.unity.types.basic.EntityParam entity)java.lang.StringprepareCredential(java.lang.String rawCredential, java.lang.String currentCredential, boolean verify)The rawCredential must be in JSON format, seePasswordTokenfor details.voidsetSerializedConfiguration(java.lang.String json)java.util.Optional<java.lang.String>updateCredentialAfterConfigurationChange(java.lang.String currentCredential)-
Methods inherited from class pl.edu.icm.unity.engine.api.authn.local.AbstractLocalVerificator
getCredentialName, getType, isSupportingInvalidation, setCredentialName
-
Methods inherited from class pl.edu.icm.unity.engine.api.authn.AbstractVerificator
getDescription, getExchangeId, getName, setIdentityResolver, setInstanceName
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Field Detail
-
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
-
DESC
public static final java.lang.String DESC
- See Also:
- Constant Field Values
-
IDENTITY_TYPES
public static final java.lang.String[] IDENTITY_TYPES
-
-
Constructor Detail
-
PasswordVerificator
@Autowired public PasswordVerificator(pl.edu.icm.unity.engine.api.notification.NotificationProducer notificationProducer, pl.edu.icm.unity.engine.api.authn.local.CredentialHelper credentialHelper, java.util.Optional<PasswordEncodingPoolProvider> threadPoolProvider)
-
-
Method Detail
-
getSerializedConfiguration
public java.lang.String getSerializedConfiguration() throws pl.edu.icm.unity.exceptions.InternalException- Specified by:
getSerializedConfigurationin interfacepl.edu.icm.unity.engine.api.utils.StringConfigurable- Throws:
pl.edu.icm.unity.exceptions.InternalException
-
setSerializedConfiguration
public void setSerializedConfiguration(java.lang.String json) throws pl.edu.icm.unity.exceptions.InternalException- Specified by:
setSerializedConfigurationin interfacepl.edu.icm.unity.engine.api.utils.StringConfigurable- Throws:
pl.edu.icm.unity.exceptions.InternalException
-
prepareCredential
public java.lang.String prepareCredential(java.lang.String rawCredential, java.lang.String currentCredential, boolean verify) throws pl.edu.icm.unity.exceptions.IllegalCredentialException, pl.edu.icm.unity.exceptions.InternalExceptionThe rawCredential must be in JSON format, seePasswordTokenfor details.- Specified by:
prepareCredentialin interfacepl.edu.icm.unity.engine.api.authn.local.LocalCredentialVerificator- Throws:
pl.edu.icm.unity.exceptions.IllegalCredentialExceptionpl.edu.icm.unity.exceptions.InternalException
-
invalidate
public java.lang.String invalidate(java.lang.String currentCredential)
- Specified by:
invalidatein interfacepl.edu.icm.unity.engine.api.authn.local.LocalCredentialVerificator
-
checkCredentialState
public pl.edu.icm.unity.types.authn.CredentialPublicInformation checkCredentialState(java.lang.String currentCredential) throws pl.edu.icm.unity.exceptions.InternalException- Specified by:
checkCredentialStatein interfacepl.edu.icm.unity.engine.api.authn.local.LocalCredentialVerificator- Throws:
pl.edu.icm.unity.exceptions.InternalException
-
updateCredentialAfterConfigurationChange
public java.util.Optional<java.lang.String> updateCredentialAfterConfigurationChange(java.lang.String currentCredential)
- Specified by:
updateCredentialAfterConfigurationChangein interfacepl.edu.icm.unity.engine.api.authn.local.LocalCredentialVerificator- Overrides:
updateCredentialAfterConfigurationChangein classpl.edu.icm.unity.engine.api.authn.local.AbstractLocalVerificator
-
checkPassword
public pl.edu.icm.unity.engine.api.authn.AuthenticationResult checkPassword(java.lang.String username, java.lang.String password, java.lang.String formForUnknown, boolean enableAssociation, pl.edu.icm.unity.engine.api.authn.remote.AuthenticationTriggeringContext triggeringContext)Checks if the provided password is valid. If it is then it is checked if it is still fulfilling all actual rules of the credential's configuration. If not then it is returned that credential state is outdated.- Specified by:
checkPasswordin interfacePasswordExchange
-
getCredentialResetBackend
public pl.edu.icm.unity.engine.api.authn.CredentialReset getCredentialResetBackend()
- Specified by:
getCredentialResetBackendin interfacePasswordExchange- Returns:
- credential reset backend
-
isCredentialDefinitionChagneOutdatingCredentials
public boolean isCredentialDefinitionChagneOutdatingCredentials(java.lang.String newCredentialDefinition)
- Specified by:
isCredentialDefinitionChagneOutdatingCredentialsin interfacepl.edu.icm.unity.engine.api.authn.local.LocalCredentialVerificator
-
getCharacteristicsRules
public static java.util.List<edu.vt.middleware.password.CharacterRule> getCharacteristicsRules()
-
getSequencesRules
public static java.util.List<edu.vt.middleware.password.Rule> getSequencesRules()
-
isCredentialSet
public boolean isCredentialSet(pl.edu.icm.unity.types.basic.EntityParam entity) throws pl.edu.icm.unity.exceptions.EngineException- Specified by:
isCredentialSetin interfacepl.edu.icm.unity.engine.api.authn.local.LocalCredentialVerificator- Throws:
pl.edu.icm.unity.exceptions.EngineException
-
-