Interface Identity

    • Method Detail

      • getId

        String getId()
        Get the unique id for this user
        Returns:
        a unique ID
      • isEnabled

        boolean isEnabled()
                   throws IamSvcException
        Is this identity enabled?
        Returns:
        true if enabled
        Throws:
        IamSvcException - when the call cannot be completed due to a service error
      • enable

        void enable​(boolean enable)
             throws IamSvcException
        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

        void setPassword​(String password)
                  throws IamSvcException
        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 expires
        nonce - arbitrary user data used to create the tag
        Returns:
        a unique tag
        Throws:
        IamSvcException - when the call cannot be completed due to a service error
        IamIdentityDoesNotExist - when the identity doesn't exist
        IamBadRequestException - when the request is now allowed
      • createApiKey

        ApiKey createApiKey()
                     throws IamSvcException
        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

        Collection<String> loadApiKeysForUser()
                                       throws IamSvcException
        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

        void deleteApiKey​(ApiKey key)
                   throws IamSvcException
        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

        Set<String> getGroupIds()
                         throws IamSvcException
        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
      • getGroup

        Group getGroup​(String groupId)
                throws IamSvcException
        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