How to add new Control center user

This article explains how to add a new Control Center user when using realm as SQL/Postgres.

 Instructions

Please follow the steps below in your SQL/Postgres terminal to add a new CC user with super admin access:

  1. Check for Existing User:
    Execute the following command to verify if the required user already exists in the cc_users table:

    select * from cc_users;

    If the user does not exist, please create the user using an INSERT statement generated using the helper tool. Please check here for documentation.

    cd. /opt/hivemq/extensions/hivemq-enterprise-security-extension/helper/linux ./hivemq-ese-helper db create control-center-user new_cc_user new_password"

    or

    cd /opt/hivemq/extensions/hivemq-enterprise-security-extension/helper/jvm java -jar hivemq-ese-helper.jar db create control-center-user ain-sw_usr "H};cMYqq%6q2aj"

    Copy that statement and execute it in the SQL/Postgres terminal.

  2. Confirm User Addition:
    Verify that the user has been successfully added to the database by checking the cc_users table again. Copy the user_id, as it will be needed in later steps.

  3. Check for Super Admin Role:
    Check the cc_roles table to confirm that a super admin role exists in the database, and copy the role_id of the super admin role:

  4. Verify User Roles:
    Check the cc_user_roles table to see if the combination of user_id (from Step 2) and role_id (from Step 3) already exists:

  5. Add User Role:
    If no entry is found, add the user role using the following INSERT statement, substituting the appropriate user_id and role_id:

  6. Final Verification:
    Verify that the entry has been successfully added to the cc_user_roles table. If confirmed, start HiveMQ and attempt to log in with the newly added user in the Control Center.

Please note that roles and permissions are cached for the day, so you will not be able to log in immediately using the newly added user. For immediate effect, you can restart the extension as well.

 Related articles