kayx23 opened a new issue, #10682:
URL: https://github.com/apache/apisix/issues/10682

   ### Current Behavior
   
   If you set `lazy_load_paths` to true in `keycloak-authz` but not configure 
`client_secret`, you get 503 error:
   
   
![image](https://github.com/apache/apisix/assets/39619599/b37b11c8-54f3-4233-941d-0a75980a9c83)
   
   
   ### Expected Behavior
   
   It is better to return a meaningful error message, such as:
   
   
![image](https://github.com/apache/apisix/assets/39619599/f5d9ceff-6190-4c7b-820e-d0a4e4dbe738)
   
   
   ### Error Logs
   
   _No response_
   
   ### Steps to Reproduce
   
   I have keycloak running at `192.168.1.83`.
   
   Create a route:
   
   ```shell
   $ curl http://127.0.0.1:9180/apisix/admin/routes/1 -X PUT -d '
   {
       "uri": "/*",
       "plugins": {
           "authz-keycloak": {
               "lazy_load_paths": true,
               "discovery": 
"http://192.168.1.83:8080/realms/quickstart-realm/.well-known/openid-configuration";,
               "client_id": "apisix-quickstart-client"
           }
       },
       "upstream": {
           "type": "roundrobin",
           "nodes": {
               "httpbin.org": 1
           }
       }
   }'
   ```
   
   Send a request to the route:
   
   ```shell
   $ curl "http://127.0.0.1:9080/anything"; -H "Authorization: Bearer 
$ACCESS_TOKEN"
   ```
   
   The access token was previously obtained from the token endpoint of keycloak.
   
   ### Environment
   
   - APISIX version (run `apisix version`): 3.7.0
   


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