Skip to content

Commit 2a01413

Browse files
authored
Avoid using auth_jwt_require
1 parent d41d566 commit 2a01413

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,14 @@ Any errors generated by the OpenID Connect flow are logged to the error log, `/v
199199
* Check for `could not be resolved` and `empty JWK set while sending to client` messages in the error log. This is common when NGINX Plus cannot reach the IdP's `jwks_uri` endpoint.
200200
* Check the `map…$oidc_jwt_keyfile` variable is correct.
201201
* Check the `resolver` directive in **openid_connect.server_conf** is reachable from the NGINX Plus host.
202-
* Check for `OIDC authorization code sent but token response is not JSON.` messages in the error log. This is common when NGINX Plus cannot decompress the IdP's response. Try add the following configuration snippet to the `/_jwks_uri` and `/_token` locations in the openid_connect.server_conf file.
202+
* Check for `OIDC authorization code sent but token response is not JSON.` messages in the error log. This is common when NGINX Plus cannot decompress the IdP's response. Add the following configuration snippet to the `/_jwks_uri` and `/_token` locations to **openid_connect.server_conf**:
203203
```nginx
204-
proxy_set_header Accept-Encoding "gzip";
204+
proxy_set_header Accept-Encoding "gzip";
205205
```
206206

207207
* **Authentication is successful but browser shows too many redirects**
208208
* This is typically because the JWT sent to the browser cannot be validated, resulting in 'authorization required' `401` response and starting the authentication process again. But the user is already authenticated so is redirected back to NGINX, hence the redirect loop.
209+
* Avoid using `auth_jwt_require` directives in your configuration because this can also return a `401` which is indistinguishable from missing/expired JWT.
209210
* Check the error log `/var/log/nginx/error.log` for JWT/JWK errors.
210211
* Ensure that the JWK file (`map…$oidc_jwt_keyfile` variable) is correct and that the nginx user has permission to read it.
211212

0 commit comments

Comments
 (0)