Package io.continual.iam.identity
Interface IdentityDb<I extends Identity>
- All Known Subinterfaces:
IamDb<I,,G> IdentityManager<I>
- All Known Implementing Classes:
CommonJsonDb,JsonDocDb,MultiSourceDb
public interface IdentityDb<I extends Identity>
An identity database, mainly for authenticating users.
-
Method Summary
Modifier and TypeMethodDescriptionAuthenticate with an API key and signatureAuthenticate with a JWT tokenAuthenticate with a username and passwordCreate a JWT token for the given identity.voidinvalidateJwtToken(String jwtToken) Invalidate the given JWT tokenLoad a user from the identity manager.loadUserOrAlias(String userIdOrAlias) Load a user from the identity manager.booleanuserExists(String userId) Find out if a given user exists.booleanuserOrAliasExists(String userIdOrAlias) Find out if a given user or alias exists.
-
Method Details
-
userExists
Find out if a given user exists.- Parameters:
userId- a user ID- Returns:
- true if the user exists in the identity manager.
- Throws:
IamSvcException- when the call cannot be completed due to a service error
-
userOrAliasExists
Find out if a given user or alias exists.- Parameters:
userIdOrAlias- the user ID or an alias- Returns:
- true if the user exists by userId or alias in the identity manager.
- Throws:
IamSvcException- when the call cannot be completed due to a service error
-
loadUser
Load a user from the identity manager.- Parameters:
userId- a user ID- Returns:
- a user or null if the user doesn't exist
- Throws:
IamSvcException- when the call cannot be completed due to a service error
-
loadUserOrAlias
Load a user from the identity manager.- Parameters:
userIdOrAlias- the actual userId or an alias- Returns:
- a user or null if the user doesn't exist
- Throws:
IamSvcException- when the call cannot be completed due to a service error
-
authenticate
Authenticate with a username and password- Parameters:
upc- the username/password credential- Returns:
- an authenticated identity or null
- Throws:
IamSvcException- when the call cannot be completed due to a service error
-
authenticate
Authenticate with an API key and signature- Parameters:
akc- the API key credential- Returns:
- an authenticated identity or null
- Throws:
IamSvcException- when the call cannot be completed due to a service error
-
authenticate
Authenticate with a JWT token- Parameters:
jwt- the JWT credential- Returns:
- an authenticated identity or null
- Throws:
IamSvcException- when the call cannot be completed due to a service error
-
createJwtToken
Create a JWT token for the given identity.- Parameters:
ii- an identity- Returns:
- a JWT token
- Throws:
IamSvcException- when the call cannot be completed due to a service error
-
invalidateJwtToken
Invalidate the given JWT token- Parameters:
jwtToken- a JWT token- Throws:
IamSvcException- when the call cannot be completed due to a service error
-