diff --git a/README.md b/README.md index fcf9d33..a0ad90e 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ environment variables is used in this image: * `OID_CLIENT_ID`: OpenID Client ID * `OID_CLIENT_SECRET`: OpenID Client Secret * `OIDC_AUTH_METHOD`: OpenID Connect authentication method (`client_secret_basic` or `client_secret_post`) -* `OIDC_RENEW_ACCESS_TOKEN_ON_EXPIERY`: Enable silent renew of access token (`true` or `false`) +* `OIDC_RENEW_ACCESS_TOKEN_ON_EXPIRY`: Enable silent renew of access token (`true` or `false`) * `PROXY_HOST`: Host name of the service to proxy * `PROXY_PORT`: Port of the service to proxy diff --git a/nginx/conf/nginx.conf b/nginx/conf/nginx.conf index ca23892..01c0530 100644 --- a/nginx/conf/nginx.conf +++ b/nginx/conf/nginx.conf @@ -15,6 +15,8 @@ env OID_CLIENT_SECRET; env OID_REDIRECT_PATH; env OIDC_AUTH_SCOPE; env OIDC_AUTH_METHOD; +env OIDC_RENEW_ACCESS_TOKEN_ON_EXPIRY; +# Keeping typo 'OIDC_RENEW_ACCESS_TOKEN_ON_EXPIERY' for backwards compatibility env OIDC_RENEW_ACCESS_TOKEN_ON_EXPIERY; env PROXY_HOST; env PROXY_PORT; diff --git a/nginx/lua/auth.lua b/nginx/lua/auth.lua index ee79f09..5ddad93 100644 --- a/nginx/lua/auth.lua +++ b/nginx/lua/auth.lua @@ -4,7 +4,8 @@ local opts = { client_id = os.getenv("OID_CLIENT_ID"), client_secret = os.getenv("OID_CLIENT_SECRET"), token_endpoint_auth_method = os.getenv("OIDC_AUTH_METHOD") or "client_secret_basic", - renew_access_token_on_expiry = os.getenv("OIDC_RENEW_ACCESS_TOKEN_ON_EXPIERY") ~= "false", + -- Backwards compatible with typo 'OIDC_RENEW_ACCESS_TOKEN_ON_EXPIERY' + renew_access_token_on_expiry = os.getenv("OIDC_RENEW_ACCESS_TOKEN_ON_EXPIRY") ~= "false" and os.getenv("OIDC_RENEW_ACCESS_TOKEN_ON_EXPIERY") ~= "false", scope = os.getenv("OIDC_AUTH_SCOPE") or "openid", iat_slack = 600, }