Skip to content

Conversation

@route443
Copy link
Contributor

Remove the proxy_pass_request_body off directive, which unintentionally broke OIDC client authentication using the POST body method (client_secret_post).

Previously, when $oidc_client_auth_method was set to "client_secret_post" the generateTokenRequestParams() function correctly formatted the POST request and sent it via r.subrequest to the internal /_token location. However, the proxy_pass_request_body off directive caused the POST request to reach $oidc_token_endpoint with a valid Content-Length header but an empty body. This led to a timeout as the OP token endpoint closed the connection.

Users encountered the error: "NGINX / OpenID Connect login failure."

This commit restores functionality by ensuring the request body is passed to the token endpoint while retaining header exclusion to prevent CORS issues.

Remove the `proxy_pass_request_body off` directive, which unintentionally broke OIDC client authentication using the POST body method (`client_secret_post`). Previously, when `$oidc_client_auth_method` was set to "client_secret_post" the `generateTokenRequestParams()` function correctly formatted the POST request and sent it via `r.subrequest` to the internal `/_token` location. However, the `proxy_pass_request_body off` directive caused the POST request to reach `$oidc_token_endpoint` with a valid Content-Length header but an empty body. This led to a timeout as the OP token endpoint closed the connection. Users encountered the error: "NGINX / OpenID Connect login failure." This commit restores functionality by ensuring the request body is passed to the token endpoint while retaining header exclusion to prevent CORS issues.
@route443 route443 merged commit 1da0cc1 into nginxinc:main Dec 12, 2024
@route443 route443 deleted the fix-post-auth branch December 12, 2024 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant