Interface IdentityResolver


  • public interface IdentityResolver
    Allows for resolving an identity into entity, returning also its credential.

    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 Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String getDisplayedUserName​(pl.edu.icm.unity.types.basic.EntityParam entity)  
      java.util.List<pl.edu.icm.unity.types.basic.Identity> getIdentitiesForEntity​(pl.edu.icm.unity.types.basic.EntityParam entity)
      Resolves EntityParam to list of all Identities, if missing throws exception
      pl.edu.icm.unity.types.basic.Identity insertIdentity​(pl.edu.icm.unity.types.basic.IdentityParam toAdd, pl.edu.icm.unity.types.basic.EntityParam entity)
      Insert identity in DB.
      boolean isEntityEnabled​(long entity)  
      EntityWithCredential resolveEntity​(long entityId, java.lang.String credentialName)
      Provides information about entity including its credential
      EntityWithCredential resolveIdentity​(java.lang.String identity, java.lang.String[] identityTypes, java.lang.String credentialName)
      Resolves an identity for performing authentication.
      long resolveIdentity​(java.lang.String identity, java.lang.String[] identityTypes, java.lang.String target, java.lang.String realm)
      Simple version that only resolves, but doesn't establish any local credential.
      EntityWithCredential resolveSubject​(AuthenticationSubject subject, java.lang.String[] identityTypes, java.lang.String credentialName)
      Provides information about subject including its credential
    • Method Detail

      • resolveIdentity

        EntityWithCredential resolveIdentity​(java.lang.String identity,
                                             java.lang.String[] identityTypes,
                                             java.lang.String credentialName)
                                      throws pl.edu.icm.unity.exceptions.EngineException
        Resolves an identity for performing authentication. It is guaranteed that the returned entity has not the disabled authentication state.
        Parameters:
        identity - raw identity value
        identityTypes - what are the types of the identity, in the preference order
        credentialName - what credential should be provided in the returned object. Can be null - then no credential is set in the returned object.
        Returns:
        the entity info with the credential value
        Throws:
        pl.edu.icm.unity.exceptions.IllegalIdentityValueException - if the given identity is not present in the db
        pl.edu.icm.unity.exceptions.EngineException
      • resolveEntity

        EntityWithCredential resolveEntity​(long entityId,
                                           java.lang.String credentialName)
                                    throws pl.edu.icm.unity.exceptions.EngineException
        Provides information about entity including its credential
        Throws:
        pl.edu.icm.unity.exceptions.EngineException
      • resolveSubject

        EntityWithCredential resolveSubject​(AuthenticationSubject subject,
                                            java.lang.String[] identityTypes,
                                            java.lang.String credentialName)
                                     throws pl.edu.icm.unity.exceptions.IllegalIdentityValueException,
                                            pl.edu.icm.unity.exceptions.IllegalTypeException,
                                            pl.edu.icm.unity.exceptions.IllegalGroupValueException,
                                            pl.edu.icm.unity.exceptions.EngineException
        Provides information about subject including its credential
        Throws:
        pl.edu.icm.unity.exceptions.IllegalIdentityValueException
        pl.edu.icm.unity.exceptions.IllegalTypeException
        pl.edu.icm.unity.exceptions.IllegalGroupValueException
        pl.edu.icm.unity.exceptions.EngineException
      • resolveIdentity

        long resolveIdentity​(java.lang.String identity,
                             java.lang.String[] identityTypes,
                             java.lang.String target,
                             java.lang.String realm)
                      throws pl.edu.icm.unity.exceptions.EngineException
        Simple version that only resolves, but doesn't establish any local credential. Useful for remote verificators.
        Throws:
        pl.edu.icm.unity.exceptions.EngineException
      • isEntityEnabled

        boolean isEntityEnabled​(long entity)
      • getDisplayedUserName

        java.lang.String getDisplayedUserName​(pl.edu.icm.unity.types.basic.EntityParam entity)
                                       throws pl.edu.icm.unity.exceptions.EngineException
        Throws:
        pl.edu.icm.unity.exceptions.EngineException
      • getIdentitiesForEntity

        java.util.List<pl.edu.icm.unity.types.basic.Identity> getIdentitiesForEntity​(pl.edu.icm.unity.types.basic.EntityParam entity)
                                                                              throws pl.edu.icm.unity.exceptions.IllegalIdentityValueException
        Resolves EntityParam to list of all Identities, if missing throws exception
        Parameters:
        entity - Describes search criteria
        Returns:
        List of Identity
        Throws:
        pl.edu.icm.unity.exceptions.IllegalIdentityValueException - for missing entity
      • insertIdentity

        pl.edu.icm.unity.types.basic.Identity insertIdentity​(pl.edu.icm.unity.types.basic.IdentityParam toAdd,
                                                             pl.edu.icm.unity.types.basic.EntityParam entity)
                                                      throws pl.edu.icm.unity.exceptions.IllegalIdentityValueException
        Insert identity in DB.
        Parameters:
        toAdd - Describes Identity details
        entity - EntityParam describing search criteria
        Returns:
        Created Identity
        Throws:
        pl.edu.icm.unity.exceptions.IllegalIdentityValueException - In case of basic rules check failure.