Set scopes for access token returned by Keycloak

Viewed 642

I was following this tutorial https://medium.com/@sairamkrish/keycloak-integration-part-3-integration-with-python-django-backend-5dac3b4a8e4e

And my access token looks something like this:

  "realm_access": {
    "roles": [
      "Engineer",
      "offline_access",
      "uma_authorization"
    ]
  },
  "resource_access": {
    "test": {
      "roles": [
        "super-user"
      ]
    },
    "account": {
      "roles": [
        "manage-account",
        "manage-account-links",
        "view-profile"
      ]
    }
  },
  "scope": "openid profile email",

With RPTs I know I can get permissions/scopes using

curl -X POST \
  http://${host}:${port}/auth/realms/${realm}/protocol/openid-connect/token \
  -H "Authorization: Bearer ${access_token}" \
  --data "grant_type=urn:ietf:params:oauth:grant-type:uma-ticket" \
  --data "audience={resource_server_client_id}"

Is there a way to get the authorization scopes I created into "scope" along with the openid, email, profile because if I do need to get permissions it looks like I still need to have an access token first.

0 Answers
Related