Interface CredentialReset


  • public interface CredentialReset
    Implementations provide a credential reset functionality. Typically are bound to a particular credential type. Additionally implementation instances must be stateful and maintain an identity for which the reset is performed.
    Author:
    K. Benedyczak
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String getCredentialConfiguration()  
      java.lang.Long getEntityId()
      Get credential owner entity id
      java.lang.String getSecurityQuestion()  
      java.lang.String getSettings()  
      void sendCode​(java.lang.String messageTemplateId, boolean onlyNumberCode)
      Sends a random confirmation code to the receiver.
      void setSubject​(pl.edu.icm.unity.types.basic.IdentityTaV subject)
      Sets the subject for which the operations are made.
      void updateCredential​(java.lang.String newCredential)
      Changes the credential to a new one.
      void verifyDynamicData​(java.lang.String emailCode)
      Verifies if the dynamic data about the subject is correct.
      void verifyStaticData​(java.lang.String aswer)
      Verifies if the static data is about the subject is correct.
    • Method Detail

      • getSettings

        java.lang.String getSettings()
        Returns:
        settings of credential reset
      • setSubject

        void setSubject​(pl.edu.icm.unity.types.basic.IdentityTaV subject)
        Sets the subject for which the operations are made.
        Parameters:
        subject -
      • getSecurityQuestion

        java.lang.String getSecurityQuestion()
        Returns:
        the question for the subject, which must be set before. If the question is not defined, a random question is returned, from the configured ones.
      • verifyStaticData

        void verifyStaticData​(java.lang.String aswer)
                       throws pl.edu.icm.unity.exceptions.WrongArgumentException,
                              pl.edu.icm.unity.exceptions.IllegalIdentityValueException,
                              pl.edu.icm.unity.exceptions.TooManyAttempts
        Verifies if the static data is about the subject is correct. Currently only the security question answer.
        Parameters:
        aswer -
        Throws:
        pl.edu.icm.unity.exceptions.WrongArgumentException
        pl.edu.icm.unity.exceptions.IllegalIdentityValueException
        pl.edu.icm.unity.exceptions.TooManyAttempts
      • verifyDynamicData

        void verifyDynamicData​(java.lang.String emailCode)
                        throws pl.edu.icm.unity.exceptions.WrongArgumentException,
                               pl.edu.icm.unity.exceptions.TooManyAttempts
        Verifies if the dynamic data about the subject is correct. Currently only the email code.
        Parameters:
        emailCode -
        Throws:
        pl.edu.icm.unity.exceptions.WrongArgumentException
        pl.edu.icm.unity.exceptions.TooManyAttempts
      • sendCode

        void sendCode​(java.lang.String messageTemplateId,
                      boolean onlyNumberCode)
               throws pl.edu.icm.unity.exceptions.EngineException
        Sends a random confirmation code to the receiver.
        Throws:
        pl.edu.icm.unity.exceptions.EngineException
      • getCredentialConfiguration

        java.lang.String getCredentialConfiguration()
        Returns:
        JSON with the current credential configuration of the subject
      • updateCredential

        void updateCredential​(java.lang.String newCredential)
                       throws pl.edu.icm.unity.exceptions.EngineException
        Changes the credential to a new one.
        Parameters:
        newCredential - new credential, typically encoded in credential specific way.
        Throws:
        pl.edu.icm.unity.exceptions.EngineException
      • getEntityId

        java.lang.Long getEntityId()
        Get credential owner entity id
        Returns: