Class 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.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

      Fields 
      Modifier and Type Field Description
      protected static int MAX_ANSWER_ATTEMPTS  
      protected pl.edu.icm.unity.engine.api.authn.EntityWithCredential resolved  
    • 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)  
    • Field Detail

      • 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)
    • 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:
        getEntityId in interface pl.edu.icm.unity.engine.api.authn.CredentialReset
      • getSettings

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

        public void verifyDynamicData​(java.lang.String answer)
                               throws pl.edu.icm.unity.exceptions.WrongArgumentException,
                                      pl.edu.icm.unity.exceptions.TooManyAttempts
        Specified by:
        verifyDynamicData in interface pl.edu.icm.unity.engine.api.authn.CredentialReset
        Throws:
        pl.edu.icm.unity.exceptions.WrongArgumentException
        pl.edu.icm.unity.exceptions.TooManyAttempts
      • getCredentialConfiguration

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

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