设置Keycloak返回的访问令牌的作用域

时间:2020-06-23 14:30:44

标签: keycloak

我正在关注本教程https://medium.com/@sairamkrish/keycloak-integration-part-3-integration-with-python-django-backend-5dac3b4a8e4e

我的访问令牌看起来像这样:

  "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",

有了RPT,我知道我可以使用以下权限/范围

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}"

有没有一种方法可以将我创建的授权范围以及openid,email和配置文件放入“作用域”中,因为如果确实需要获得许可,那么看来我仍然需要首先拥有访问令牌。

0 个答案:

没有答案
相关问题