-
Notifications
You must be signed in to change notification settings - Fork 4k
Description
Is your feature request related to a problem? Please describe.
Some OAuth providers, like Azure/Entra v.2 endpoints, do not accept the request parameter resource in the authorization request. And others like Auth0 requires the audience parameter.
Describe the solution you'd like
RabbitMQ currently sends the following request parameters to the authorization endpoint:
resourcewhose default value is theresource_server_idscopewhose value comes frommanagement.oauth_scopesormanagement.oauth_resource_servers.$name.oauth_scopesand if it is not configured it is defaulted toopenid profileresponse_typewhose value comes frommanagement.oauth_response_typeand if it is not configured it is defaulted tocode- (optional)
client_secretwhose value comes frommanagement.oauth_client_secretif present client_idwhose value comes frommanagement.oauth_clientaudiencewhose value is theresource_server_id(Required by Auth0)
The best approach going forward is to stop providing default values and instead document the appropriate values for each of the supported OAuth providers.
The schema of rabbitmq_auth_backend_oauth2 and rabbitmq_management will change to accommodate these changes.
Setting RabbitMQ OAuth2 for azure :
If the user does not configure the Azure Registered Application for RabbitMQ with a custom signing key, the user does not need to make any further configuration. Just specify the issuer url pointing to the v2.0 api.
if the user configures a custom signing key, the user can configure the discovery_endpoint_params as follows:
auth_oauth2.discovery_endpoint_params.appid = ${resource_server_id}
or the following configuration if there is only one resource configured in RabbitMQ configuration.
auth_oauth2.discovery_endpoint_params.appid = the_resource_server_id
Given this configuration entry, RabbitMQ uses the issuer followed by the default openid's discovery endpoint path (/.well-known/openid-configuration) or auth_oauth2.discovery_endpoint_path variable to discover all the openid endpoints. The returned jwks_uri endpoint contains the app_id query parameter.
Setting RabbitMQ OAuth2 for auth0 :
Auth0's users must change their RabbitMQ configuration as follows:
auth_oauth2.token_endpoint_params.audience = ${resource_server_id}
auth_oauth2.authorization_endpoint_params.audience = ${resource_server_id}