Bootstrap FreeKB - RabbitMQ - Validate username password using the rabbitmqctl command
RabbitMQ - Validate username password using the rabbitmqctl command

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



Comments


Add a Comment


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