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:
Check for Existing User:
Execute the following command to verify if the required user already exists in thecc_userstable:select * from cc_users;If the user does not exist, please create the user using an
INSERTstatement 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.
Confirm User Addition:
Verify that the user has been successfully added to the database by checking thecc_userstable again. Copy theuser_id, as it will be needed in later steps.Check for Super Admin Role:
Check thecc_rolestable to confirm that a super admin role exists in the database, and copy therole_idof the super admin role:select * from cc_roles;Verify User Roles:
Check thecc_user_rolestable to see if the combination ofuser_id(from Step 2) androle_id(from Step 3) already exists:select * from cc_user_roles;Add User Role:
If no entry is found, add the user role using the followingINSERTstatement, substituting the appropriateuser_idandrole_id:insert into cc_user_roles (user_id, role_id) values (user_id_from_step_2, role_id_from_step_3);Final Verification:
Verify that the entry has been successfully added to thecc_user_rolestable. 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.