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
Modifier and TypeMethodDescriptiongetDisplayedUserName
(pl.edu.icm.unity.base.entity.EntityParam entity) List<pl.edu.icm.unity.base.identity.Identity>
getIdentitiesForEntity
(pl.edu.icm.unity.base.entity.EntityParam entity) ResolvesEntityParam
to list of all Identities, if missing throws exceptionpl.edu.icm.unity.base.identity.Identity
insertIdentity
(pl.edu.icm.unity.base.identity.IdentityParam toAdd, pl.edu.icm.unity.base.entity.EntityParam entity) Insert identity in DB.boolean
isEntityEnabled
(long entity) resolveEntity
(long entityId, String credentialName) Provides information about entity including its credentialresolveIdentity
(String identity, String[] identityTypes, String credentialName) Resolves an identity for performing authentication.long
resolveIdentity
(String identity, String[] identityTypes, String target, String realm) Simple version that only resolves, but doesn't establish any local credential.pl.edu.icm.unity.base.identity.Identity
resolveSubject
(AuthenticationSubject subject, String identityType) Provides information about subject including its credentialresolveSubject
(AuthenticationSubject subject, String[] identityTypes, String credentialName) Provides information about subject including its credential
-
Method Details
-
resolveIdentity
EntityWithCredential resolveIdentity(String identity, String[] identityTypes, String credentialName) throws pl.edu.icm.unity.base.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 valueidentityTypes
- what are the types of the identity, in the preference ordercredentialName
- 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.base.identity.IllegalIdentityValueException
- if the given identity is not present in the dbpl.edu.icm.unity.base.exceptions.EngineException
-
resolveEntity
EntityWithCredential resolveEntity(long entityId, String credentialName) throws pl.edu.icm.unity.base.exceptions.EngineException Provides information about entity including its credential- Throws:
pl.edu.icm.unity.base.exceptions.EngineException
-
resolveSubject
EntityWithCredential resolveSubject(AuthenticationSubject subject, String[] identityTypes, String credentialName) throws pl.edu.icm.unity.base.identity.IllegalIdentityValueException, IllegalTypeException, IllegalGroupValueException, pl.edu.icm.unity.base.exceptions.EngineException Provides information about subject including its credential- Throws:
pl.edu.icm.unity.base.identity.IllegalIdentityValueException
IllegalTypeException
IllegalGroupValueException
pl.edu.icm.unity.base.exceptions.EngineException
-
resolveSubject
pl.edu.icm.unity.base.identity.Identity resolveSubject(AuthenticationSubject subject, String identityType) throws pl.edu.icm.unity.base.identity.IllegalIdentityValueException, IllegalTypeException, IllegalGroupValueException, pl.edu.icm.unity.base.exceptions.EngineException Provides information about subject including its credential- Throws:
pl.edu.icm.unity.base.identity.IllegalIdentityValueException
IllegalTypeException
IllegalGroupValueException
pl.edu.icm.unity.base.exceptions.EngineException
-
resolveIdentity
long resolveIdentity(String identity, String[] identityTypes, String target, String realm) throws pl.edu.icm.unity.base.exceptions.EngineException Simple version that only resolves, but doesn't establish any local credential. Useful for remote verificators.- Throws:
pl.edu.icm.unity.base.exceptions.EngineException
-
isEntityEnabled
boolean isEntityEnabled(long entity) -
getDisplayedUserName
String getDisplayedUserName(pl.edu.icm.unity.base.entity.EntityParam entity) throws pl.edu.icm.unity.base.exceptions.EngineException - Throws:
pl.edu.icm.unity.base.exceptions.EngineException
-
getIdentitiesForEntity
List<pl.edu.icm.unity.base.identity.Identity> getIdentitiesForEntity(pl.edu.icm.unity.base.entity.EntityParam entity) throws pl.edu.icm.unity.base.identity.IllegalIdentityValueException ResolvesEntityParam
to list of all Identities, if missing throws exception- Parameters:
entity
- Describes search criteria- Returns:
- List of
Identity
- Throws:
pl.edu.icm.unity.base.identity.IllegalIdentityValueException
- for missing entity
-
insertIdentity
pl.edu.icm.unity.base.identity.Identity insertIdentity(pl.edu.icm.unity.base.identity.IdentityParam toAdd, pl.edu.icm.unity.base.entity.EntityParam entity) throws pl.edu.icm.unity.base.identity.IllegalIdentityValueException Insert identity in DB.- Parameters:
toAdd
- DescribesIdentity
detailsentity
-EntityParam
describing search criteria- Returns:
- Created
Identity
- Throws:
pl.edu.icm.unity.base.identity.IllegalIdentityValueException
- In case of basic rules check failure.
-