Interface LegacyIdentityService
public interface LegacyIdentityService
This is a collection of identity related methods which either should not exist, or belong elsewhere.
The intent is to break this apart over time, until it can be removed.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
doesIdentityExist
(String universalId) Checks whether a given non-null universal ID exists.findActiveIdentities
(Realm realm, IdType idType, Map<String, Set<String>> searchAttributes, IdSearchOpModifier searchModifier) Searches for AM identities with the given attributes in the given realm.Searches for an AM identity with the given attributes in the given realm.getAmIdentity
(SSOToken token, String identityName, IdType idType, String realm) Create anAMIdentity
using the specified information.getIdentityName
(String universalId) Determines the name of the identity based on the provided universal ID.getIdentityUniversalId
(String subject, String realmPath) Convert an identity subject to anAMIdentity
universal id.getUniversalId
(String identityName, IdType idType, String realm) Determines the universal ID of the user based on the provided details.getUniversalId
(String username, String realmPath, IdType idType) Determines the universal ID of the user based on the username and the realm.
-
Method Details
-
getIdentityName
Determines the name of the identity based on the provided universal ID.- Parameters:
universalId
- the universal ID of the identity- Returns:
- the name of the identity, or null if the name could not be determined
-
doesIdentityExist
Checks whether a given non-null universal ID exists.- Parameters:
universalId
- non-null universal ID- Returns:
- whether the universal ID exists
- Throws:
IdentityException
- if there's an error reading from the identity repository
-
getAmIdentity
AMIdentity getAmIdentity(SSOToken token, String identityName, IdType idType, String realm) throws IdRepoException Create anAMIdentity
using the specified information.- Parameters:
token
- the identity's SSO TokenidentityName
- the name of the identityidType
- the type of the identityrealm
- the realm this identity belongs to- Returns:
- the
AMIdentity
based on the provided parameters - Throws:
IdRepoException
-
getUniversalId
Determines the universal ID of the user based on the provided details.- Parameters:
identityName
- the name of the identityidType
- the type of the identityrealm
- the realm this identity belongs to- Returns:
- the universal ID based on the provided parameters
- Throws:
IdRepoException
-
getUniversalId
Determines the universal ID of the user based on the username and the realm.- Parameters:
username
- the username attribute of the identity objectrealmPath
- the realm path of the realm the identity belongs toidType
- the type of the identity object- Returns:
- the universal ID of the identity object in the realm
-
findActiveIdentity
Optional<AMIdentity> findActiveIdentity(Realm realm, IdType idType, Map<String, Set<String>> searchAttributes) throws SSOException, IdRepoExceptionSearches for an AM identity with the given attributes in the given realm. Identity searches will be cached to improve performance.- Parameters:
realm
- the realm in which to search for identities. Cannot be nullidType
- the type of identity to find. Cannot be nullsearchAttributes
- the search attributes. Cannot be null or empty- Returns:
- the matching identity or else
Optional.empty()
if there is no unique match - Throws:
SSOException
- if there is a problem with the SSOToken used for the searchIdRepoException
- if an error occurs during the search
-
findActiveIdentities
Set<AMIdentity> findActiveIdentities(Realm realm, IdType idType, Map<String, Set<String>> searchAttributes, IdSearchOpModifier searchModifier) throws SSOException, IdRepoExceptionSearches for AM identities with the given attributes in the given realm. Identity searches will be cached to improve performance.- Parameters:
realm
- the realm in which to search for identities. Cannot be nullidType
- the type of identity to find. Cannot be nullsearchAttributes
- the search attributes. Cannot be null or emptysearchModifier
- the modifier to use to perform the search- Returns:
- the potentially empty set of matching identities
- Throws:
SSOException
- if there is a problem with the SSOToken used for the searchIdRepoException
- if an error occurs during the search
-
getIdentityUniversalId
Convert an identity subject to anAMIdentity
universal id.- Parameters:
subject
- the identity subjectrealmPath
- the realm path- Returns:
- the AM identity
- Throws:
IdRepoException
-