v1

latestOpenAPI 3.1.22026-08-0611530152.3 KB
OAuth 2.0

Update OAuth 2.0 configuration

Update the existing OAuth 2.0 configuration. This is an asynchronous operation that returns a job_id immediately. Track progress using the Jobs API.

Note: Only one operation can run at a time per resource. When operation is completed, a restart of RabbitMQ is required for changes to be applied.

put/oauth2-configurations

Request body

resource_server_idstring required

Unique identifier for the resource server

issuerstring uri required

OAuth 2.0 issuer URL (must be HTTPS)

preferred_username_claimsstring[]

JWT claim names to use for username

additional_scopes_keystring[]

JWT claim keys containing additional scopes

scope_prefixstring

Prefix to add to scopes

scope_aliasesobject

Map scope aliases to actual scopes (RabbitMQ 4.1.0+)

verify_audboolean

Whether to verify audience claim in tokens

oauth_client_idstring

Client ID for management interface

oauth_scopesstring[]

Scopes required for management interface

audiencestring

OAuth 2.0 audience claim (required for Auth0 with RabbitMQ 4.1+). Typically matches resource_server_id

oauth_disable_basic_authboolean

Disable static username/password management interface access, allowing only OAuth 2.0 authentication

Example request

{
  "resource_server_id": "rabbitmq",
  "issuer": "https://auth.example.com",
  "preferred_username_claims": [
    "sub",
    "email"
  ],
  "additional_scopes_key": [
    "roles",
    "groups"
  ],
  "scope_prefix": "my-app:",
  "scope_aliases": {
    "user": "user:read",
    "admin": "admin:access"
  },
  "verify_aud": true,
  "oauth_client_id": "oauth-client-id-456",
  "oauth_scopes": [
    "manage:clients",
    "read:users"
  ],
  "audience": "rabbitmq",
  "oauth_disable_basic_auth": true
}

Response

Configuration update initiated

job_idstring uuid

Job ID to track the asynchronous operation

Example response

{
  "job_id": "5c2f59e8-826e-452c-b28d-27ef1f8b32a3"
}