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 String
getDisplayedUserName(EntityParam entity)
List<Identity>
getIdentitiesForEntity(EntityParam entity)
ResolvesEntityParam
to list of all Identities, if missing throws exceptionIdentity
insertIdentity(IdentityParam toAdd, EntityParam entity)
Insert identity in DB.boolean
isEntityEnabled(long entity)
EntityWithCredential
resolveEntity(long entityId, String credentialName)
Provides information about entity including its credentialEntityWithCredential
resolveIdentity(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.Identity
resolveSubject(AuthenticationSubject subject, String identityType)
Provides information about subject including its credentialEntityWithCredential
resolveSubject(AuthenticationSubject subject, String[] identityTypes, String credentialName)
Provides information about subject including its credential
-
-
-
Method Detail
-
resolveIdentity
EntityWithCredential resolveIdentity(String identity, String[] identityTypes, String credentialName) throws 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:
IllegalIdentityValueException
- if the given identity is not present in the dbEngineException
-
resolveEntity
EntityWithCredential resolveEntity(long entityId, String credentialName) throws EngineException
Provides information about entity including its credential- Throws:
EngineException
-
resolveSubject
EntityWithCredential resolveSubject(AuthenticationSubject subject, String[] identityTypes, String credentialName) throws IllegalIdentityValueException, IllegalTypeException, IllegalGroupValueException, EngineException
Provides information about subject including its credential
-
resolveSubject
Identity resolveSubject(AuthenticationSubject subject, String identityType) throws IllegalIdentityValueException, IllegalTypeException, IllegalGroupValueException, EngineException
Provides information about subject including its credential
-
resolveIdentity
long resolveIdentity(String identity, String[] identityTypes, String target, String realm) throws EngineException
Simple version that only resolves, but doesn't establish any local credential. Useful for remote verificators.- Throws:
EngineException
-
isEntityEnabled
boolean isEntityEnabled(long entity)
-
getDisplayedUserName
String getDisplayedUserName(EntityParam entity) throws EngineException
- Throws:
EngineException
-
getIdentitiesForEntity
List<Identity> getIdentitiesForEntity(EntityParam entity) throws IllegalIdentityValueException
ResolvesEntityParam
to list of all Identities, if missing throws exception- Parameters:
entity
- Describes search criteria- Returns:
- List of
Identity
- Throws:
IllegalIdentityValueException
- for missing entity
-
insertIdentity
Identity insertIdentity(IdentityParam toAdd, EntityParam entity) throws IllegalIdentityValueException
Insert identity in DB.- Parameters:
toAdd
- DescribesIdentity
detailsentity
-EntityParam
describing search criteria- Returns:
- Created
Identity
- Throws:
IllegalIdentityValueException
- In case of basic rules check failure.
-
-