You can create a static username/password pair in the Message Queue for RabbitMQ console, and use the created username and password in code to access an instance from the client. This way, you no longer need to generate a dynamic username/password pair by using Message Queue for RabbitMQ SDK. This topic describes how to create a static username/password pair in the Message Queue for RabbitMQ console.
- A Message Queue for RabbitMQ instance is created and is in the running state. For more information about how to create an instance, see Create an instance.
- The account that you use to log on to the Message Queue for RabbitMQ console is an Alibaba Cloud account or a RAM user that is granted the permissions to view and create username/password pairs. For more information about account permissions and authorization operations, see RAM policies, Grant permissions to RAM users, and Grant permissions across Alibaba Cloud accounts.
- The AccessKey pair of the Alibaba Cloud account or a RAM user is obtained. For more information, see Obtain an AccessKey pair.
- Dynamic username and password: Use a permission authentication class provided by Alibaba Cloud to generate dynamic usernames and passwords.
- Static username and password (recommended): Generate static usernames and passwords in the Message Queue for RabbitMQ console. This method is the same as that of open source RabbitMQ.
- You can use an AccessKey pair to create only one static username/password pair in an instance. If you want to update a username/password pair, you must delete the existing pair and create a new pair. For more information, see Delete a static username/password pair.
- If a static username/password pair is deleted or the AccessKey pair that is used to create the static username/password pair is disabled or deleted, the static username/password pair becomes invalid. When the client uses this static username/password pair to access Message Queue for RabbitMQ, the access request is rejected.
- Log on to the Message Queue for RabbitMQ console.
- In the top navigation bar, select the region where your instance resides.
- In the left-side navigation pane, click Static Accounts Alerting.
- On the Static Accounts Alerting page, click Create Username/Password.
- In the Create Username/Password dialog box, specify AccessKey ID, AccessKey Secret, and Instance ID, and click OK.The Static Accounts Alerting page displays the created static username/password pair. By default, the password is masked.
- Click Display in the Password column.The password is unmasked in the Password column.