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 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:
        EngineException
      • setCredential

        void setCredential​(long entityId,
                           String credentialName,
                           String value,
                           LocalCredentialVerificator handler)
                    throws 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:
        EngineException