lakshya8066 commented on issue #10708:
URL: https://github.com/apache/apisix/issues/10708#issuecomment-1871819144

   @kayx23 Yes the error might be coming from APISIX. 
   
   This is the route config I used for apisix and I have a keycloack instance 
running on port 8080
   ```
   curl http://127.0.0.1:9180/apisix/admin/routes/1 -X PUT -d '
   {
       "uri": "/*",
       "plugins": {
           "authz-keycloak": {
               "token_endpoint": 
"http://localhost:8080/realms/lak-realm/protocol/openid-connect/token";,
               "client_id": "lak-client"
           }
       },
       "upstream": {
           "type": "roundrobin",
           "nodes": {
               "httpbin.org": 1
           }
       }
   }'
   ```
   I used this command get the access token: 
   `curl --location 
'http://localhost:8080/realms/lak-realm/protocol/openid-connect/token' \
   --header 'Content-Type: application/x-www-form-urlencoded' \
   --data-urlencode 'client_id=lak-client' \
   --data-urlencode 'client_secret=Tqq0WmryhDxUMDSGo7KFx3bSt8c13jQ5' \
   --data-urlencode 'grant_type=password' \
   --data-urlencode 'username=lak' \
   --data-urlencode 'password=pass123'`
   
   but while making a curl request like: `curl --location 
'http://127.0.0.1:9080/ip'
   --header 'Authorization: Bearer <ACCESS_TOKEN>'` I get this error: 
`{"error":"access_denied","error_description":"not_authorized"}`
   
   This looks like it is coming from this section
   
![image](https://github.com/apache/apisix/assets/73181332/e3763108-01dd-466b-9c17-919ddcee069b)
   But I have not set policy_enforcement_mode="ENFORCING" in the config so it 
should not matter if I give permissions parameter as an input or not.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to