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 Details

    • MAX_ANSWER_ATTEMPTS

      protected static final int MAX_ANSWER_ATTEMPTS
      See Also:
    • DEFAULT_MAX_CODE_VALIDITY

      public static final Duration 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

      public Long getEntityId()
      Specified by:
      getEntityId in interface pl.edu.icm.unity.engine.api.authn.CredentialReset
    • getSettings

      public String getSettings()
      Specified by:
      getSettings in interface pl.edu.icm.unity.engine.api.authn.CredentialReset
    • getCredentialSettings

      protected abstract String getCredentialSettings()
    • getRequestedSubject

      protected pl.edu.icm.unity.engine.api.authn.AuthenticationSubject getRequestedSubject()
    • getSecurityQuestion

      public String getSecurityQuestion()
      Specified by:
      getSecurityQuestion in interface pl.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:
      verifyStaticData in interface pl.edu.icm.unity.engine.api.authn.CredentialReset
      Throws:
      pl.edu.icm.unity.base.exceptions.WrongArgumentException
      pl.edu.icm.unity.base.identity.IllegalIdentityValueException
      pl.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:
      sendCode in interface pl.edu.icm.unity.engine.api.authn.CredentialReset
      Throws:
      pl.edu.icm.unity.base.exceptions.EngineException
    • getSentCode

      public String 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:
      verifyDynamicData in interface pl.edu.icm.unity.engine.api.authn.CredentialReset
      Throws:
      pl.edu.icm.unity.base.exceptions.WrongArgumentException
      pl.edu.icm.unity.engine.api.authn.TooManyAttempts
    • getCredentialConfiguration

      public String getCredentialConfiguration()
      Specified by:
      getCredentialConfiguration in interface pl.edu.icm.unity.engine.api.authn.CredentialReset
    • updateCredential

      public void updateCredential(String newCredential) throws pl.edu.icm.unity.base.exceptions.EngineException
      Specified by:
      updateCredential in interface pl.edu.icm.unity.engine.api.authn.CredentialReset
      Throws:
      pl.edu.icm.unity.base.exceptions.EngineException