Interface AccountManagementService

    • Method Detail

      • registerAccountManager

        void registerAccountManager​(AccountManager accountManager)
        Register an AccountManager instance with the platform. The instance is used to derive an AuthorizationMethod instance that is registered with the same name.
        Parameters:
        accountManager -
      • unregisterAccountManager

        void unregisterAccountManager​(AccountManager accountManager)
        Unregisters an AccountManager instance from the platform. An AuthorizationMethod instance with the same is unregistered automatically as well.
        Parameters:
        accountManager -
      • getAccountManagerNames

        List<String> getAccountManagerNames()
        Returns a list of known registered account manager names.
        Returns:
      • getConfiguredAccountManagerName

        String getConfiguredAccountManagerName()
        Returns the account manager name that is configured to be used by the platform by default.
        Returns:
      • createUserAccount

        Topic createUserAccount​(Credentials cred)
        Creates a user account. Only DMX admins are allowed to create user accounts.

        The user is created either with the configured account manager of the platform or with the account manager that is specified throught the "method" property of the Credentials instance.

        Returns:
        The "Username" topic of the created user account.
        Throws:
        RuntimeException - if the requesting user is not a DMX admin.
      • _createUserAccount

        Topic _createUserAccount​(Credentials cred)
        Creates a user account. This is a privileged method: no permissions are checked.

        The user is created either with the configured account manager of the platform or with the account manager that is specified throught the "method" property of the Credentials instance.

        Security: this method is not callable from outside as it has no REST interface. So the DMX platform is still secure. On the other hand, a 3rd-party plugin which provides a RESTful interface to this method is required to apply an additional authorization measure, e.g. a short-living access token sent via email.

        Returns:
        The "Username" topic of the created user account.
      • changePassword

        void changePassword​(Credentials currentCred,
                            Credentials newCred)
        Changes the password of an account to the newly given credentials.

        Depending on the system that ultimately performs the password change, the current credentials are necessary. It can be null if not necessary.

        Parameters:
        currentCred - Current credentials of the account whose password is to be changed.
        newCred - Credentials containing the new password.