Class CredentialResetBase
java.lang.Object
pl.edu.icm.unity.stdext.credential.CredentialResetBase
- All Implemented Interfaces:
pl.edu.icm.unity.engine.api.authn.CredentialReset
- Direct Known Subclasses:
PasswordCredentialResetImpl,SMSCredentialResetImpl
public abstract class CredentialResetBase
extends Object
implements pl.edu.icm.unity.engine.api.authn.CredentialReset
Base for credential reset implementation of
CredentialReset. This implementation is stateful, i.e. from creation it
must be used exclusively by a single reset procedure.- Author:
- P. Piernik
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Durationprotected static final intprotected pl.edu.icm.unity.engine.api.authn.EntityWithCredential -
Constructor Summary
ConstructorsConstructorDescriptionCredentialResetBase(pl.edu.icm.unity.engine.api.notification.NotificationProducer notificationProducer, pl.edu.icm.unity.engine.api.identity.IdentityResolver identityResolver, pl.edu.icm.unity.engine.api.authn.local.LocalCredentialVerificator localVerificator, pl.edu.icm.unity.engine.api.authn.local.CredentialHelper credentialHelper, String credentialId, com.fasterxml.jackson.databind.node.ObjectNode completeCredentialConfiguration, Duration maxCodeValidity) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanprotected abstract intprotected abstract Stringprotected pl.edu.icm.unity.engine.api.authn.AuthenticationSubjectvoidvoidsetSubject(pl.edu.icm.unity.engine.api.authn.AuthenticationSubject subject, String[] idTypes) voidupdateCredential(String newCredential) voidverifyDynamicData(String answer) voidverifyStaticData(String answer) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface pl.edu.icm.unity.engine.api.authn.CredentialReset
setSubject
-
Field Details
-
MAX_ANSWER_ATTEMPTS
protected static final int MAX_ANSWER_ATTEMPTS- See Also:
-
DEFAULT_MAX_CODE_VALIDITY
-
resolved
protected pl.edu.icm.unity.engine.api.authn.EntityWithCredential resolved
-
-
Constructor Details
-
CredentialResetBase
public CredentialResetBase(pl.edu.icm.unity.engine.api.notification.NotificationProducer notificationProducer, pl.edu.icm.unity.engine.api.identity.IdentityResolver identityResolver, pl.edu.icm.unity.engine.api.authn.local.LocalCredentialVerificator localVerificator, pl.edu.icm.unity.engine.api.authn.local.CredentialHelper credentialHelper, String credentialId, com.fasterxml.jackson.databind.node.ObjectNode completeCredentialConfiguration, Duration maxCodeValidity)
-
-
Method Details
-
setSubject
public void setSubject(pl.edu.icm.unity.engine.api.authn.AuthenticationSubject subject, String[] idTypes) -
checkSubject
protected boolean checkSubject() -
getEntityId
- Specified by:
getEntityIdin interfacepl.edu.icm.unity.engine.api.authn.CredentialReset
-
getSettings
- Specified by:
getSettingsin interfacepl.edu.icm.unity.engine.api.authn.CredentialReset
-
getCredentialSettings
-
getRequestedSubject
protected pl.edu.icm.unity.engine.api.authn.AuthenticationSubject getRequestedSubject() -
getSecurityQuestion
- Specified by:
getSecurityQuestionin interfacepl.edu.icm.unity.engine.api.authn.CredentialReset
-
verifyStaticData
public void verifyStaticData(String answer) throws pl.edu.icm.unity.base.exceptions.WrongArgumentException, pl.edu.icm.unity.base.identity.IllegalIdentityValueException, pl.edu.icm.unity.engine.api.authn.TooManyAttempts - Specified by:
verifyStaticDatain interfacepl.edu.icm.unity.engine.api.authn.CredentialReset- Throws:
pl.edu.icm.unity.base.exceptions.WrongArgumentExceptionpl.edu.icm.unity.base.identity.IllegalIdentityValueExceptionpl.edu.icm.unity.engine.api.authn.TooManyAttempts
-
getCodeLength
protected abstract int getCodeLength() -
sendCode
public void sendCode(String msgTemplate, boolean onlyNumberCode) throws pl.edu.icm.unity.base.exceptions.EngineException - Specified by:
sendCodein interfacepl.edu.icm.unity.engine.api.authn.CredentialReset- Throws:
pl.edu.icm.unity.base.exceptions.EngineException
-
getSentCode
-
verifyDynamicData
public void verifyDynamicData(String answer) throws pl.edu.icm.unity.base.exceptions.WrongArgumentException, pl.edu.icm.unity.engine.api.authn.TooManyAttempts - Specified by:
verifyDynamicDatain interfacepl.edu.icm.unity.engine.api.authn.CredentialReset- Throws:
pl.edu.icm.unity.base.exceptions.WrongArgumentExceptionpl.edu.icm.unity.engine.api.authn.TooManyAttempts
-
getCredentialConfiguration
- Specified by:
getCredentialConfigurationin interfacepl.edu.icm.unity.engine.api.authn.CredentialReset
-
updateCredential
public void updateCredential(String newCredential) throws pl.edu.icm.unity.base.exceptions.EngineException - Specified by:
updateCredentialin interfacepl.edu.icm.unity.engine.api.authn.CredentialReset- Throws:
pl.edu.icm.unity.base.exceptions.EngineException
-