RabbitMQ - Validate username password using the rabbitmqctl command

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 Buy Me A Coffee

Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.





Please enter f84de in the box below so that we can be sure you are a human.




Comments

Web design by yours truely - me, myself, and I   |   jeremy.canfield@freekb.net   |