Try with Swagger UI

I am using the Camunda 8 self managed Docker Compose full configuration:

include:
  - path: ./services/camunda/docker-compose/8.9/docker-compose-full.yaml
    env_file: ./services/camunda/docker-compose/8.9/.env

services:
  ...

I can request an access token using client credentials:

export ACCESS_TOKEN=$(curl -s POST 'http://localhost:18080/auth/realms/camunda-platform/protocol/openid-connect/token' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d "client_id=orchestration" \
  -d "client_secret=secret" \
  -d "audience=orchestration-api" \
  -d 'grant_type=client_credentials' | jq -r '.access_token')

And use the access token in API requests:

curl -s GET 'http://localhost:8080/v2/topology' \
  -H "Accept: application/json" \
  -H "Authorization: Bearer $ACCESS_TOKEN" | jq .

For example:

{
  "brokers": [
    {
      "nodeId": 0,
      "host": "0.0.0.0",
      "port": 26501,
      "partitions": [
        {
          "partitionId": 1,
          "role": "leader",
          "health": "healthy"
        }
      ],
      "version": "8.9.12"
    }
  ],
  "clusterId": "d4a1af66-ff1c-4b92-b77d-5b409a57555a",
  "clusterSize": 1,
  "partitionsCount": 1,
  "replicationFactor": 1,
  "gatewayVersion": "8.9.12",
  "lastCompletedChangeId": "-1"
}

However, if I use the access token for BearerAuth in the Swagger UI the server response is 401?

This looks like a common Swagger UI authentication issue where the token format or audience might not match what’s expected. I found the following relevant resources:

Does this help? If not, can anyone from the community jump in? :waving_hand:


:light_bulb: Hints: Use the Ask AI feature in Camunda’s documentation to chat with AI and get fast help. Report bugs and features in Camuda’s GitHub issue tracker. Trust the process. :robot:

This worked: Camunda 8 Swagger - #4 by Tarek_Mebrouk

  1. Sign in to Tasklist (demo/demo).
  2. Refresh the Swagger UI page