Skip to content

Commit d44d1c7

Browse files
authored
revert OIDC updates to unblock main (#7750)
1 parent f4ed950 commit d44d1c7

File tree

3 files changed

+249
-438
lines changed

3 files changed

+249
-438
lines changed

internal/configs/oidc/oidc.conf

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Advanced configuration START
22
set $internal_error_message "NGINX / OpenID Connect login failure\n";
33
set $pkce_id "";
4-
set $idp_sid "";
54
# resolver 8.8.8.8; # For DNS lookup of IdP endpoints;
65
subrequest_output_buffer_size 32k; # To fit a complete tokenset response
76
gunzip on; # Decompress IdP responses if necessary
@@ -38,48 +37,33 @@
3837
# to construct the OpenID Connect token request, as per:
3938
# http://openid.net/specs/openid-connect-core-1_0.html#TokenRequest
4039
internal;
41-
42-
# Exclude client headers to avoid CORS errors with certain IdPs (e.g., Microsoft Entra ID)
43-
proxy_pass_request_headers off;
44-
4540
proxy_ssl_server_name on; # For SNI to the IdP
4641
proxy_set_header Content-Type "application/x-www-form-urlencoded";
4742
proxy_set_header Authorization $arg_secret_basic;
4843
proxy_pass $oidc_token_endpoint;
49-
}
44+
}
5045

5146
location = /_refresh {
5247
# This location is called by oidcAuth() when performing a token refresh. We
5348
# use the proxy_ directives to construct the OpenID Connect token request, as per:
5449
# https://openid.net/specs/openid-connect-core-1_0.html#RefreshingAccessToken
5550
internal;
56-
57-
# Exclude client headers to avoid CORS errors with certain IdPs (e.g., Microsoft Entra ID)
58-
proxy_pass_request_headers off;
59-
6051
proxy_ssl_server_name on; # For SNI to the IdP
6152
proxy_set_header Content-Type "application/x-www-form-urlencoded";
6253
proxy_set_header Authorization $arg_secret_basic;
6354
proxy_pass $oidc_token_endpoint;
6455
}
6556

66-
location = /_token_validation {
57+
location = /_id_token_validation {
6758
# This location is called by oidcCodeExchange() and oidcRefreshRequest(). We use
6859
# the auth_jwt_module to validate the OpenID Connect token response, as per:
6960
# https://openid.net/specs/openid-connect-core-1_0.html#IDTokenValidation
7061
internal;
7162
auth_jwt "" token=$arg_token;
72-
js_content oidc.extractTokenClaims;
63+
js_content oidc.validateIdToken;
7364
error_page 500 502 504 @oidc_error;
7465
}
7566

76-
location = /front_channel_logout {
77-
status_zone "OIDC logout";
78-
add_header Cache-Control "no-store";
79-
default_type text/plain;
80-
js_content oidc.handleFrontChannelLogout;
81-
}
82-
8367
location = /logout {
8468
status_zone "OIDC logout";
8569
add_header Set-Cookie "auth_token=; $oidc_cookie_flags";

internal/configs/oidc/oidc_common.conf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ proxy_cache_path /var/cache/nginx/jwk levels=1 keys_zone=jwk:64k max_size=1m;
2020
keyval_zone zone=oidc_id_tokens:1M timeout=1h sync;
2121
keyval_zone zone=oidc_access_tokens:1M timeout=1h sync;
2222
keyval_zone zone=refresh_tokens:1M timeout=8h sync;
23-
keyval_zone zone=oidc_sids:1M timeout=8h;
2423
#keyval_zone zone=oidc_pkce:128K timeout=90s sync; # Temporary storage for PKCE code verifier.
2524

2625
keyval $cookie_auth_token $session_jwt zone=oidc_id_tokens; # Exchange cookie for ID token(JWT)
@@ -29,7 +28,6 @@ keyval $cookie_auth_token $refresh_token zone=refresh_tokens; # Exchange coo
2928
keyval $request_id $new_session zone=oidc_id_tokens; # For initial session creation
3029
keyval $request_id $new_access_token zone=oidc_access_tokens;
3130
keyval $request_id $new_refresh zone=refresh_tokens; # ''
32-
keyval $idp_sid $client_sid zone=oidc_sids;
3331
#keyval $pkce_id $pkce_code_verifier zone=oidc_pkce;
3432

3533
auth_jwt_claim_set $jwt_audience aud; # In case aud is an array

0 commit comments

Comments
 (0)