apache / apisix

The Cloud-Native API Gateway
https://apisix.apache.org/blog/
Apache License 2.0
14.52k stars 2.52k forks source link

help request: how to enable authz-keycloak for accessing apisix-dashboard? #8642

Closed MirtoBusico closed 10 months ago

MirtoBusico commented 1 year ago

Description

Hi all, I've setup a working environment to access apisix-dashboard from everywere.

The access path is user -> nginx load balancer -> apisix (authenticated with openid-connect plugin) -> apisix dashboard

The framework is the one described in #8452

Now that openid-connect works correctly, I'm trying to add authorization to the route.

What happen is:

The route definition is

{
  "uri": "/*",
  "name": "apisix-dashboard",
  "desc": "apisix.h.net route",
  "methods": [
    "GET",
    "POST",
    "PUT",
    "DELETE",
    "PATCH",
    "HEAD",
    "OPTIONS",
    "CONNECT",
    "TRACE"
  ],
  "host": "apisix.h.net",
  "plugins": {
    "authz-keycloak": {
      "client_id": "hcadmins",
      "disable": false,
      "permissions": [
        "adm-apisix-resource"
      ],
      "token_endpoint": "https://k6k.h.net/realms/hcluster_admins/protocol/openid-connect/token"
    },
    "openid-connect": {
      "access_token_in_authorization_header": true,
      "bearer_only": false,
      "client_id": "hcadmins",
      "client_secret": "MoqLUhwgsEDi36II0KuJldKq4YGLHxl3",
      "disable": false,
      "discovery": "https://k6k.h.net/realms/hcluster_admins/.well-known/openid-configuration",
      "introspection_endpoint_auth_method": "client_secret_post",
      "realm": "hcluster_admins",
      "redirect_uri": "https://apisix.h.net/*",
      "scope": "openid profile"
    },
    "redirect": {
      "http_to_https": true
    }
  },
  "upstream_id": "440140633500287791",
  "status": 1
}

What works:

What don't work:

I don't see anything interesting in the apisix pod logs and in the apisix-dashboard pod log

What can I do?

Environment

github-actions[bot] commented 10 months ago

This issue has been marked as stale due to 350 days of inactivity. It will be closed in 2 weeks if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the dev@apisix.apache.org list. Thank you for your contributions.

github-actions[bot] commented 10 months ago

This issue has been closed due to lack of activity. If you think that is incorrect, or the issue requires additional review, you can revive the issue at any time.