In previous chapters, we learned how to create exchanges, queues and bindings in rabbitmq. Now, we will learn how to create a new user and give required permissions to new user in rabbitmq web management portal.
To create a new user, we need to login into rabbitmq web management plugin using default credentials (guest) like as shown below.
After logging into the application, to create a new user we need to navigate to Admin tab for that click on Admin tab like as shown below.
After navigate to Admin tab, we can see the default user (“guest”) details who is having “administrator” privileges and below that we have Add a user panel to add new user like as shown below.
After we click on “Add a user” panel, it will show the panel with different parameters to create a new user like as shown below.
If you observe above picture, we have a section called Tags. Here, Tags are the rights or privileges which we assigned while creating a user and we can set single or multiple privileges to a user based on our requirements. In case, if we want to multiple privileges, then set privileges as a comma (,) separated like administrator, management, etc. based on our requirements.
Following are the different type of privileges or rights which supported in management plugin while creating a new user in rabbitmq.
|management||If we set this tag, the user can access management plugin.|
|policymaker||If we set this tag, the user can access management plugin and manage policies and parameters for the vhosts they have access to.|
|monitoring||If we set this tag, the user can access management plugin and see all the connections and channels as well as node-related information.|
|administrator||If we set this tag, the user can do everything in management like manage users, vhosts, permissions, close other user's connections, and manage policies and parameters for all vhosts.|
Now, we will create a new user (demouser) by entering all the required details like password as “123456”, privilege as “administrator” and click on Add user button to a create new user like as shown below.
After adding a user, you can see all the users in All users panel for that just expand it like as shown below.
After expanding, you can see the new user “demouser” but in the grid, you can see “can access virtual hosts” columns where it has the value “No access” which means we do not have the privilege to virtual hosts.
To set a permission to access virtual hosts, just click on the username which we have created “demouser” and go to Permissions panel which is just below to overview panel and click on Set permission button to set permissions like as shown below.
Once we are done with permission settings, then we can see the user permissions under “Current permissions” like as shown below.
Now we will use newly created user (“demouser”) details to login into rabbitmq web management plugin like as shown below.
Following is the snapshot of rabbitmq web management plugin after logging with new user “demouser”.
This is how we can create a new users and assign a required permissions in rabbitmq using web management plugin.