public class IdentityServiceImpl extends ServiceImpl implements IdentityService
commandExecutor| Constructor and Description |
|---|
IdentityServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkPassword(String userId,
String password)
Checks if the password is valid for the given user.
|
PasswordPolicyResult |
checkPasswordAgainstPolicy(PasswordPolicy policy,
String password)
Check a given password against a given
PasswordPolicy. |
PasswordPolicyResult |
checkPasswordAgainstPolicy(PasswordPolicy policy,
String candidatePassword,
User user)
Check a given password against a given
PasswordPolicy. |
PasswordPolicyResult |
checkPasswordAgainstPolicy(String password)
Check a given password against the configured
PasswordPolicy. |
PasswordPolicyResult |
checkPasswordAgainstPolicy(String candidatePassword,
User user)
Check a given password against the configured
PasswordPolicy. |
void |
clearAuthentication()
Allows clearing the current authentication.
|
GroupQuery |
createGroupQuery()
Creates a
GroupQuery thats allows to programmatically query the groups. |
void |
createMembership(String userId,
String groupId) |
NativeUserQuery |
createNativeUserQuery()
Creates a
NativeUserQuery that allows to select users with native queries. |
void |
createTenantGroupMembership(String tenantId,
String groupId)
Creates a new membership between the given group and tenant.
|
TenantQuery |
createTenantQuery()
Creates a
TenantQuery thats allows to programmatically query the
tenants. |
void |
createTenantUserMembership(String tenantId,
String userId)
Creates a new membership between the given user and tenant.
|
UserQuery |
createUserQuery()
Creates a
UserQuery that allows to programmatically query the users. |
void |
deleteGroup(String groupId)
Deletes the group.
|
void |
deleteMembership(String userId,
String groupId)
Delete the membership of the user in the group.
|
void |
deleteTenant(String tenantId)
Deletes the tenant.
|
void |
deleteTenantGroupMembership(String tenantId,
String groupId)
Deletes the membership between the given group and tenant.
|
void |
deleteTenantUserMembership(String tenantId,
String userId)
Deletes the membership between the given user and tenant.
|
void |
deleteUser(String userId) |
void |
deleteUserAccount(String userId,
String accountName)
Delete an entry of the generic extensibility key-value pairs associated with a user
|
void |
deleteUserInfo(String userId,
String key)
Delete an entry of the generic extensibility key-value pairs associated with a user
|
void |
deleteUserPicture(String userId)
Deletes the picture for a given user.
|
Authentication |
getCurrentAuthentication() |
PasswordPolicy |
getPasswordPolicy()
Returns the
PasswordPolicy that is currently configured in the
engine. |
Account |
getUserAccount(String userId,
String userPassword,
String accountName)
Get account information associated with a user
|
List<String> |
getUserAccountNames(String userId)
Get account names associated with the given user
|
String |
getUserInfo(String userId,
String key)
Generic extensibility key-value pairs associated with a user
|
List<String> |
getUserInfoKeys(String userId)
Generic extensibility keys associated with a user
|
Picture |
getUserPicture(String userId)
Retrieves the picture for a given user.
|
boolean |
isReadOnly()
Allows to inquire whether this identity service implementation provides
read-only access to the user repository, false otherwise.
|
Group |
newGroup(String groupId)
Creates a new group.
|
Tenant |
newTenant(String tenantId)
Creates a new tenant.
|
User |
newUser(String userId)
Creates a new user.
|
void |
saveGroup(Group group)
Saves the group.
|
void |
saveTenant(Tenant tenant)
Saves the tenant.
|
void |
saveUser(User user)
Saves the user.
|
void |
saveUser(User user,
boolean skipPasswordPolicy) |
void |
setAuthenticatedUserId(String authenticatedUserId)
Passes the authenticated user id for this thread.
|
void |
setAuthentication(Authentication auth) |
void |
setAuthentication(String userId,
List<String> groups)
Passes the authenticated user id and groupIds for this thread.
|
void |
setAuthentication(String userId,
List<String> groups,
List<String> tenantIds)
Passes the authenticated user id, group ids and tenant ids for this thread.
|
void |
setUserAccount(String userId,
String userPassword,
String accountName,
String accountUsername,
String accountPassword,
Map<String,String> accountDetails)
Store account information for a remote system
|
void |
setUserInfo(String userId,
String key,
String value)
Generic extensibility key-value pairs associated with a user
|
void |
setUserPicture(String userId,
Picture picture)
Sets the picture for a given user.
|
void |
unlockUser(String userId) |
getCommandExecutor, setCommandExecutorpublic boolean isReadOnly()
IdentityServiceAllows to inquire whether this identity service implementation provides read-only access to the user repository, false otherwise.
Read only identity service implementations do not support the following methods:IdentityService.newUser(String) IdentityService.saveUser(User) IdentityService.deleteUser(String) IdentityService.newGroup(String) IdentityService.saveGroup(Group) IdentityService.deleteGroup(String) IdentityService.newTenant(String) IdentityService.saveTenant(Tenant) IdentityService.deleteTenant(String) IdentityService.createMembership(String, String) IdentityService.deleteMembership(String, String) IdentityService.createTenantUserMembership(String, String) IdentityService.createTenantGroupMembership(String, String) IdentityService.deleteTenantUserMembership(String, String) IdentityService.deleteTenantGroupMembership(String, String) If these methods are invoked on a read-only identity service implementation,
the invocation will throw an UnsupportedOperationException.
isReadOnly in interface IdentityServicepublic Group newGroup(String groupId)
IdentityServiceIdentityService.saveGroup(Group).newGroup in interface IdentityServicegroupId - id for the new group, cannot be null.public User newUser(String userId)
IdentityServiceIdentityService.saveUser(User).newUser in interface IdentityServiceuserId - id for the new user, cannot be null.public Tenant newTenant(String tenantId)
IdentityServiceIdentityService.saveTenant(Tenant).newTenant in interface IdentityServicetenantId - id for the new tenant, cannot be null.public void saveGroup(Group group)
IdentityServicesaveGroup in interface IdentityServicegroup - group to save. Cannot be null.public void saveUser(User user)
IdentityServicesaveUser in interface IdentityServiceuser - user to save, cannot be null.public void saveUser(User user, boolean skipPasswordPolicy)
public void saveTenant(Tenant tenant)
IdentityServicesaveTenant in interface IdentityServicetenant - the tenant to save. Cannot be null.public UserQuery createUserQuery()
IdentityServiceUserQuery that allows to programmatically query the users.createUserQuery in interface IdentityServicepublic NativeUserQuery createNativeUserQuery()
IdentityServiceNativeUserQuery that allows to select users with native queries.createNativeUserQuery in interface IdentityServicepublic GroupQuery createGroupQuery()
IdentityServiceGroupQuery thats allows to programmatically query the groups.createGroupQuery in interface IdentityServicepublic TenantQuery createTenantQuery()
IdentityServiceTenantQuery thats allows to programmatically query the
tenants.createTenantQuery in interface IdentityServicepublic void createMembership(String userId, String groupId)
createMembership in interface IdentityServiceuserId - the userId, cannot be null.groupId - the groupId, cannot be null.public void deleteGroup(String groupId)
IdentityServicedeleteGroup in interface IdentityServicegroupId - id of the group that should be deleted, cannot be null.public void deleteMembership(String userId, String groupId)
IdentityServicedeleteMembership in interface IdentityServiceuserId - the user's id, cannot be null.groupId - the group's id, cannot be null.public boolean checkPassword(String userId, String password)
IdentityServicecheckPassword in interface IdentityServicepublic PasswordPolicyResult checkPasswordAgainstPolicy(String candidatePassword, User user)
IdentityServicePasswordPolicy. The result
is returned as PasswordPolicyResult which contains all
passed and violated rules as well as a flag indicating if the password is
valid.checkPasswordAgainstPolicy in interface IdentityServicecandidatePassword - which is checked against a password policyuser - to be taken into account when checking the candidate passwordPasswordPolicyResult containing passed and
failed rulespublic PasswordPolicyResult checkPasswordAgainstPolicy(String password)
IdentityServicePasswordPolicy. The result
is returned as PasswordPolicyResult which contains all
passed and violated rules as well as a flag indicating if the password is
valid.checkPasswordAgainstPolicy in interface IdentityServicepassword - the password that should be testedPasswordPolicyResult containing passed and
failed rulespublic PasswordPolicyResult checkPasswordAgainstPolicy(PasswordPolicy policy, String candidatePassword, User user)
IdentityServicePasswordPolicy. The result
is returned as PasswordPolicyResult which contains all
passed and violated rules as well as a flag indicating if the password is
valid.checkPasswordAgainstPolicy in interface IdentityServicepolicy - the PasswordPolicy against which the password is testedcandidatePassword - which is checked against a password policyuser - to be taken into account when checking the candidate passwordPasswordPolicyResult containing passed and
failed rulespublic PasswordPolicyResult checkPasswordAgainstPolicy(PasswordPolicy policy, String password)
IdentityServicePasswordPolicy. The result
is returned as PasswordPolicyResult which contains all
passed and violated rules as well as a flag indicating if the password is
valid.checkPasswordAgainstPolicy in interface IdentityServicepolicy - the PasswordPolicy against which the password is testedpassword - the password that should be testedPasswordPolicyResult containing passed and
failed rulespublic PasswordPolicy getPasswordPolicy()
IdentityServicePasswordPolicy that is currently configured in the
engine.getPasswordPolicy in interface IdentityServicePasswordPolicy or null if no
policy is set or the configured policy is disabled.public void unlockUser(String userId)
unlockUser in interface IdentityServicepublic void deleteUser(String userId)
deleteUser in interface IdentityServiceuserId - id of user to delete, cannot be null. When an id is passed
for an unexisting user, this operation is ignored.public void deleteTenant(String tenantId)
IdentityServicedeleteTenant in interface IdentityServicetenantId - id of the tenant that should be deleted, cannot be
null.public void setUserPicture(String userId, Picture picture)
IdentityServicesetUserPicture in interface IdentityServicepicture - can be null to delete the picture.public Picture getUserPicture(String userId)
IdentityServicegetUserPicture in interface IdentityServicepublic void deleteUserPicture(String userId)
IdentityServicedeleteUserPicture in interface IdentityServicepublic void setAuthenticatedUserId(String authenticatedUserId)
IdentityServiceIdentityService.clearAuthentication() once the interaction is terminated.setAuthenticatedUserId in interface IdentityServiceauthenticatedUserId - the id of the current user.public void setAuthentication(Authentication auth)
setAuthentication in interface IdentityServicepublic void setAuthentication(String userId, List<String> groups)
IdentityServiceIdentityService.clearAuthentication() once the interaction is terminated.setAuthentication in interface IdentityServicegroups - the groups of the current user.public void setAuthentication(String userId, List<String> groups, List<String> tenantIds)
IdentityServiceIdentityService.clearAuthentication() once the interaction is terminated.setAuthentication in interface IdentityServiceuserId - the id of the current user.groups - the groups of the current user.tenantIds - the tenants of the current user.public void clearAuthentication()
IdentityServiceclearAuthentication in interface IdentityServicepublic Authentication getCurrentAuthentication()
getCurrentAuthentication in interface IdentityServicepublic String getUserInfo(String userId, String key)
IdentityServicegetUserInfo in interface IdentityServicepublic List<String> getUserInfoKeys(String userId)
IdentityServicegetUserInfoKeys in interface IdentityServicepublic List<String> getUserAccountNames(String userId)
IdentityServicegetUserAccountNames in interface IdentityServicepublic void setUserInfo(String userId, String key, String value)
IdentityServicesetUserInfo in interface IdentityServicepublic void deleteUserInfo(String userId, String key)
IdentityServicedeleteUserInfo in interface IdentityServicepublic void deleteUserAccount(String userId, String accountName)
IdentityServicedeleteUserAccount in interface IdentityServicepublic Account getUserAccount(String userId, String userPassword, String accountName)
IdentityServicegetUserAccount in interface IdentityServicepublic void setUserAccount(String userId, String userPassword, String accountName, String accountUsername, String accountPassword, Map<String,String> accountDetails)
IdentityServicesetUserAccount in interface IdentityServicepublic void createTenantUserMembership(String tenantId, String userId)
IdentityServicecreateTenantUserMembership in interface IdentityServicetenantId - the id of the tenant, cannot be null.userId - the id of the user, cannot be null.public void createTenantGroupMembership(String tenantId, String groupId)
IdentityServicecreateTenantGroupMembership in interface IdentityServicetenantId - the id of the tenant, cannot be null.groupId - the id of the group, cannot be null.public void deleteTenantUserMembership(String tenantId, String userId)
IdentityServicedeleteTenantUserMembership in interface IdentityServicetenantId - the id of the tenant, cannot be null.userId - the id of the user, cannot be null.public void deleteTenantGroupMembership(String tenantId, String groupId)
IdentityServicedeleteTenantGroupMembership in interface IdentityServicetenantId - the id of the tenant, cannot be null.groupId - the id of the group, cannot be null.Copyright © 2022. All rights reserved.