0
0
RabbitMQdevops~30 mins

Authentication backends (LDAP, OAuth) in RabbitMQ - Mini Project: Build & Apply

Choose your learning style9 modes available
Configure RabbitMQ Authentication Backends with LDAP and OAuth
📖 Scenario: You are setting up RabbitMQ on a company server. The company wants to secure access by using two authentication methods: LDAP for employees and OAuth for external apps.This project will guide you step-by-step to configure RabbitMQ to use LDAP and OAuth authentication backends.
🎯 Goal: By the end, you will have a RabbitMQ configuration file that enables LDAP and OAuth authentication backends with the correct settings.
📋 What You'll Learn
Create a RabbitMQ configuration file with LDAP backend settings
Add OAuth backend configuration to the same file
Use correct syntax for RabbitMQ config in Erlang terms format
Print the final configuration content
💡 Why This Matters
🌍 Real World
Companies often use RabbitMQ for messaging and want to secure it by integrating with existing user directories (LDAP) and modern identity providers (OAuth).
💼 Career
Knowing how to configure RabbitMQ authentication backends is important for DevOps engineers managing secure messaging infrastructure.
Progress0 / 4 steps
1
Create the initial RabbitMQ configuration with LDAP backend
Create a variable called rabbitmq_config as a string containing the RabbitMQ configuration. Include the auth_backends list with rabbit_auth_backend_ldap as the only backend. Also add the ldap settings with servers set to ["ldap.company.com"] and user_dn_pattern set to "uid=${username},ou=users,dc=company,dc=com".
RabbitMQ
Need a hint?

Remember to use triple quotes for multi-line string and Erlang terms syntax for RabbitMQ config.

2
Add OAuth backend to the authentication backends list
Add rabbit_auth_backend_oauth2 to the auth_backends list in the rabbitmq_config string, so it contains both rabbit_auth_backend_ldap and rabbit_auth_backend_oauth2.
RabbitMQ
Need a hint?

Make sure both backends are inside the auth_backends list separated by a comma.

3
Add OAuth2 backend configuration settings
Add an auth_oauth2 section inside the rabbit config in rabbitmq_config. Set issuer to "https://auth.company.com", client_id to "rabbitmq-client", and client_secret to "supersecret".
RabbitMQ
Need a hint?

Follow the Erlang config format carefully. The auth_oauth2 section is a list of key-value tuples inside the rabbit config.

4
Print the final RabbitMQ configuration
Write a print statement to display the content of the rabbitmq_config variable.
RabbitMQ
Need a hint?

Use print(rabbitmq_config) to show the full configuration string.