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 java.lang.Object implements pl.edu.icm.unity.engine.api.authn.CredentialResetBase for credential reset implementation ofCredentialReset. This implementation is stateful, i.e. from creation it must be used exclusively by a single reset procedure.- Author:
- P. Piernik
-
-
Field Summary
Fields Modifier and Type Field Description static java.time.DurationDEFAULT_MAX_CODE_VALIDITYprotected static intMAX_ANSWER_ATTEMPTSprotected pl.edu.icm.unity.engine.api.authn.EntityWithCredentialresolved
-
Constructor Summary
Constructors Constructor Description 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, java.lang.String credentialId, com.fasterxml.jackson.databind.node.ObjectNode completeCredentialConfiguration, java.time.Duration maxCodeValidity)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected booleancheckSubject()protected abstract intgetCodeLength()java.lang.StringgetCredentialConfiguration()protected abstract java.lang.StringgetCredentialSettings()java.lang.LonggetEntityId()protected pl.edu.icm.unity.engine.api.authn.AuthenticationSubjectgetRequestedSubject()java.lang.StringgetSecurityQuestion()java.lang.StringgetSentCode()java.lang.StringgetSettings()voidsendCode(java.lang.String msgTemplate, boolean onlyNumberCode)voidsetSubject(pl.edu.icm.unity.engine.api.authn.AuthenticationSubject subject, java.lang.String[] idTypes)voidupdateCredential(java.lang.String newCredential)voidverifyDynamicData(java.lang.String answer)voidverifyStaticData(java.lang.String answer)
-
-
-
Field Detail
-
MAX_ANSWER_ATTEMPTS
protected static final int MAX_ANSWER_ATTEMPTS
- See Also:
- Constant Field Values
-
DEFAULT_MAX_CODE_VALIDITY
public static final java.time.Duration DEFAULT_MAX_CODE_VALIDITY
-
resolved
protected pl.edu.icm.unity.engine.api.authn.EntityWithCredential resolved
-
-
Constructor Detail
-
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, java.lang.String credentialId, com.fasterxml.jackson.databind.node.ObjectNode completeCredentialConfiguration, java.time.Duration maxCodeValidity)
-
-
Method Detail
-
setSubject
public void setSubject(pl.edu.icm.unity.engine.api.authn.AuthenticationSubject subject, java.lang.String[] idTypes)
-
checkSubject
protected boolean checkSubject()
-
getEntityId
public java.lang.Long getEntityId()
- Specified by:
getEntityIdin interfacepl.edu.icm.unity.engine.api.authn.CredentialReset
-
getSettings
public java.lang.String getSettings()
- Specified by:
getSettingsin interfacepl.edu.icm.unity.engine.api.authn.CredentialReset
-
getCredentialSettings
protected abstract java.lang.String getCredentialSettings()
-
getRequestedSubject
protected pl.edu.icm.unity.engine.api.authn.AuthenticationSubject getRequestedSubject()
-
getSecurityQuestion
public java.lang.String getSecurityQuestion()
- Specified by:
getSecurityQuestionin interfacepl.edu.icm.unity.engine.api.authn.CredentialReset
-
verifyStaticData
public void verifyStaticData(java.lang.String answer) throws pl.edu.icm.unity.exceptions.WrongArgumentException, pl.edu.icm.unity.exceptions.IllegalIdentityValueException, pl.edu.icm.unity.exceptions.TooManyAttempts- Specified by:
verifyStaticDatain interfacepl.edu.icm.unity.engine.api.authn.CredentialReset- Throws:
pl.edu.icm.unity.exceptions.WrongArgumentExceptionpl.edu.icm.unity.exceptions.IllegalIdentityValueExceptionpl.edu.icm.unity.exceptions.TooManyAttempts
-
getCodeLength
protected abstract int getCodeLength()
-
sendCode
public void sendCode(java.lang.String msgTemplate, boolean onlyNumberCode) throws pl.edu.icm.unity.exceptions.EngineException- Specified by:
sendCodein interfacepl.edu.icm.unity.engine.api.authn.CredentialReset- Throws:
pl.edu.icm.unity.exceptions.EngineException
-
getSentCode
public java.lang.String getSentCode()
-
verifyDynamicData
public void verifyDynamicData(java.lang.String answer) throws pl.edu.icm.unity.exceptions.WrongArgumentException, pl.edu.icm.unity.exceptions.TooManyAttempts- Specified by:
verifyDynamicDatain interfacepl.edu.icm.unity.engine.api.authn.CredentialReset- Throws:
pl.edu.icm.unity.exceptions.WrongArgumentExceptionpl.edu.icm.unity.exceptions.TooManyAttempts
-
getCredentialConfiguration
public java.lang.String getCredentialConfiguration()
- Specified by:
getCredentialConfigurationin interfacepl.edu.icm.unity.engine.api.authn.CredentialReset
-
updateCredential
public void updateCredential(java.lang.String newCredential) throws pl.edu.icm.unity.exceptions.EngineException- Specified by:
updateCredentialin interfacepl.edu.icm.unity.engine.api.authn.CredentialReset- Throws:
pl.edu.icm.unity.exceptions.EngineException
-
-