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

   ### Description
   
   I am trying to use an environment variables approach described here 
https://apisix.apache.org/docs/apisix/terminology/secret/#use-environment-variables-to-manage-secrets
 to configure authz-keycloak plugin.
   
   For that, I use the following configuration (created via admin api):
   
   ```
   {
   "uris": [
       "/manual/httpbin/*"
     ],
     "name": "manual httpbin",
     "methods": [
       "GET"
     ],
     "hosts": [
       "api.msp.komus.local"
     ],
     "upstream_id": "...",
     "plugins": {
                "proxy-rewrite": {
                        "regex_uri": [
                                                "^\/manual\/httpbin\/(.*)",
                                                "\/$1"
                        ]
                },
                "authz-keycloak":{
                        "discovery": "$ENV://KEYCLOAK_DISCOVERY",
                        "client_id": "<KEYCLOAK_CLIENT_ID>",
                        "policy_enforcement_mode": "PERMISSIVE",
                        "ssl_verify": false
                }
        }
   }
   ```
   
   Environment variable KEYCLOAK_DISCOVERY is defined and is accessible for the 
gateway. However the environment variable is not resolved, the following error 
is in the logs.
   
   ```
   [error] 50#50: *44516 [lua] authz-keycloak.lua:240: 
authz_keycloak_discover(): Accessing discovery URL ($ENV://KEYCLOAK_DISCOVERY) 
failed: bad uri: $ENV://KEYCLOAK_DISCOVERY
   ```
   
   Can someone point me into the right direction?
   
   ### Environment
   
   - APISIX version (run `apisix version`): 3.3.0
   - Operating system (run `uname -a`): Linux 6.1.32-0-virt #1-Alpine
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`): 
openresty/1.21.4.1
   


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