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 Details

    • userExists

      boolean userExists(String userId) throws IamSvcException
      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

      boolean userOrAliasExists(String userIdOrAlias) throws IamSvcException
      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

      I loadUser(String userId) throws IamSvcException
      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

      I loadUserOrAlias(String userIdOrAlias) throws IamSvcException
      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

      I authenticate(UsernamePasswordCredential upc) throws IamSvcException
      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

      I authenticate(ApiKeyCredential akc) throws IamSvcException
      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

      I authenticate(JwtCredential jwt) throws IamSvcException
      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

      String createJwtToken(Identity ii) throws IamSvcException
      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

      void invalidateJwtToken(String jwtToken) throws IamSvcException
      Invalidate the given JWT token
      Parameters:
      jwtToken - a JWT token
      Throws:
      IamSvcException - when the call cannot be completed due to a service error