Interface CredentialHelper


  • public interface CredentialHelper
    Allows for performing various credential related operations which needs to be handled internally, not via the public API.

    This interface is intended for an internal use, as it performs all operations without any authorization. It should be used by the authentication related components as credential validators or authenticators.

    Author:
    K. Benedyczak
    • Method Detail

      • updateCredential

        void updateCredential​(long entityId,
                              String credentialName,
                              String dbEncodedCredentialState)
                       throws pl.edu.icm.unity.exceptions.EngineException
        Updates the credential in DB. This feature is required to perform a sort of callback: credentials may need to update themselves in DB, e.g. to invalidate them in case when it is detected during login that the current password is not valid anymore.

        IMPORTANT: the last argument must be given in a database format, i.e. must be already result of processing by an appropriate credential handler. Therefore this method is useful to be called from a verificator itself.

        Parameters:
        entityId -
        credentialName -
        dbEncodedCredentialState -
        Throws:
        pl.edu.icm.unity.exceptions.EngineException
      • setCredential

        void setCredential​(long entityId,
                           String credentialName,
                           String value,
                           LocalCredentialVerificator handler)
                    throws pl.edu.icm.unity.exceptions.EngineException
        Updates the credential in DB. This is the same code as IdentitiesManagement#setEntityCredential(pl.edu.icm.unity.types.basic.EntityParam, String, String) but requires no authorization.
        Parameters:
        entityId -
        credentialName -
        value -
        Throws:
        pl.edu.icm.unity.exceptions.EngineException
      • isCredentialSet

        boolean isCredentialSet​(pl.edu.icm.unity.types.basic.EntityParam entity,
                                String credentialId)
                         throws pl.edu.icm.unity.exceptions.EngineException
        Check if credential is set
        Parameters:
        entity -
        credentialId -
        Returns:
        Throws:
        pl.edu.icm.unity.exceptions.EngineException
      • getCredentialDefinitions

        Map<String,​pl.edu.icm.unity.types.authn.CredentialDefinition> getCredentialDefinitions()
                                                                                              throws pl.edu.icm.unity.exceptions.EngineException
        Get credential definitions as map
        Returns:
        Throws:
        pl.edu.icm.unity.exceptions.EngineException