RabbitMQ - Validate username password using the rabbitmqctl command

by
Jeremy Canfield |
Updated: June 03 2021
| RabbitMQ articles
The rabbitmqctl command with the eval option can be used to determine if a certain username and password is valid. In this example, we will check if john.doe and itsasecret is valid.
rabbitmqctl eval 'rabbit_access_control:check_user_login(<<"john.doe">>, [{password, <<"itsasecret">>}]).'
If the username and password are valid, ok should be returned.
{ok,{user,<<"john.doe">>,[administrator],[{rabbit_auth_backend_internal,none}]}}
If the username and passward are invalid, refused should be returned.
{refused,<<"admin">>,"cn=admin,ou=users,o=acme",[]}
Did you find this article helpful?
If so, consider buying me a coffee over at