Skip to content

Commit f7e8726

Browse files
authored
Do not pass client headers or body to the IdP token endpoint
1 parent 133504f commit f7e8726

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

openid_connect.server_conf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@
3737
# to construct the OpenID Connect token request, as per:
3838
# http://openid.net/specs/openid-connect-core-1_0.html#TokenRequest
3939
internal;
40+
41+
# Do not pass through body or headers from the client, this should be a net-new connection.
42+
# Some IdPs, like Microsoft Entra, will throw CORS errors if client headers are passed through.
43+
proxy_pass_request_headers off;
44+
proxy_pass_request_body off;
45+
4046
proxy_ssl_server_name on; # For SNI to the IdP
4147
proxy_set_header Content-Type "application/x-www-form-urlencoded";
4248
proxy_set_header Authorization $arg_secret_basic;
@@ -48,6 +54,12 @@
4854
# use the proxy_ directives to construct the OpenID Connect token request, as per:
4955
# https://openid.net/specs/openid-connect-core-1_0.html#RefreshingAccessToken
5056
internal;
57+
58+
# Do not pass through body or headers from the client, this should be a net-new connection.
59+
# Some IdPs, like Microsoft Entra, will throw CORS errors if client headers are passed through.
60+
proxy_pass_request_headers off;
61+
proxy_pass_request_body off;
62+
5163
proxy_ssl_server_name on; # For SNI to the IdP
5264
proxy_set_header Content-Type "application/x-www-form-urlencoded";
5365
proxy_set_header Authorization $arg_secret_basic;

0 commit comments

Comments
 (0)