Package io.continual.iam.identity
Interface Identity
- All Superinterfaces:
UserDataHolder
- All Known Implementing Classes:
CommonJsonIdentity
An identity (user) in this system.
-
Method Summary
Modifier and TypeMethodDescriptionCreate an API key for this user.voiddeleteApiKey(ApiKey key) Delete an API key from the user.voidenable(boolean enable) Enable or disable the user.Get a group by ID if the user is a member.Get the IDs of the groups this user belongs toGet the groups this user belongs togetId()Get the unique id for this userbooleanIs this identity enabled?Load the set of API keys for this user.requestPasswordReset(long secondsUntilExpire, String nonce) Request a password reset.voidsetPassword(String password) Set the user's password.Methods inherited from interface io.continual.iam.identity.UserDataHolder
getAllUserData, getUserData, putUserData, reload, removeUserData
-
Method Details
-
getId
String getId()Get the unique id for this user- Returns:
- a unique ID
-
isEnabled
Is this identity enabled?- Returns:
- true if enabled
- Throws:
IamSvcException- when the call cannot be completed due to a service error
-
enable
Enable or disable the user. When disabled, authentication will fail.- Parameters:
enable- if true, enable the user- Throws:
IamSvcException- when the call cannot be completed due to a service error
-
setPassword
Set the user's password. Implementations of this interface should be careful to store the password indirectly (e.g. via salted hash), but this is not enforced at the interface layer.- Parameters:
password- a password- Throws:
IamSvcException- when the call cannot be completed due to a service error
-
requestPasswordReset
String requestPasswordReset(long secondsUntilExpire, String nonce) throws IamSvcException, IamBadRequestException Request a password reset. The response is a unique tag that would normally be distributed to the user via email as a link. The user acknowledges the password change request by clicking the link. The link handler then calls completePasswordReset().- Parameters:
secondsUntilExpire- amount of time until the generated tag expiresnonce- arbitrary user data used to create the tag- Returns:
- a unique tag
- Throws:
IamSvcException- when the call cannot be completed due to a service errorIamIdentityDoesNotExist- when the identity doesn't existIamBadRequestException- when the request is now allowed
-
createApiKey
Create an API key for this user.- Returns:
- an API key
- Throws:
IamSvcException- when the call cannot be completed due to a service error
-
loadApiKeysForUser
Load the set of API keys for this user.- Returns:
- a set of 0 or more API keys
- Throws:
IamSvcException- when the call cannot be completed due to a service error
-
deleteApiKey
Delete an API key from the user.- Parameters:
key- the API key to remove- Throws:
IamSvcException- when the call cannot be completed due to a service error
-
getGroupIds
Get the IDs of the groups this user belongs to- Returns:
- a set of group IDs
- Throws:
IamSvcException- when the call cannot be completed due to a service error
-
getGroups
Get the groups this user belongs to- Returns:
- a set of groups
- Throws:
IamSvcException- when the call cannot be completed due to a service error
-
getGroup
Get a group by ID if the user is a member. Otherwise, null is returned.- Parameters:
groupId- the ID of the group to retrieve- Returns:
- a group or null if not a member
- Throws:
IamSvcException- when the call cannot be completed due to a service error
-