File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -259,7 +259,7 @@ function getAuthZArgs(r) {
259259
260260 authZArgs += "&code_challenge_method=S256&code_challenge=" + pkce_code_challenge + "&state=" + r . variables . pkce_id ;
261261 } else {
262- authZArgs += "&state=0" ;
262+ authZArgs += "&state=" + r . variables . state ;
263263 }
264264 return authZArgs ;
265265}
@@ -272,4 +272,4 @@ function idpClientAuth(r) {
272272 } else {
273273 return "code=" + r . variables . arg_code + "&client_secret=" + r . variables . oidc_client_secret ;
274274 }
275- }
275+ }
Original file line number Diff line number Diff line change 3939 internal ;
4040 proxy_ssl_server_name on; # For SNI to the IdP
4141 proxy_set_header Content-Type "application/x-www-form-urlencoded" ;
42- proxy_set_body "grant_type=authorization_code&client_id=$oidc_client&$args&redirect_uri=$redirect_base$redir_location" ;
42+ proxy_set_body "grant_type=authorization_code&client_id=$oidc_client&state=$state& $args&redirect_uri=$redirect_base$redir_location" ;
4343 proxy_method POST;
4444 proxy_pass $oidc_token_endpoint ;
4545 }
5151 internal ;
5252 proxy_ssl_server_name on; # For SNI to the IdP
5353 proxy_set_header Content-Type "application/x-www-form-urlencoded" ;
54- proxy_set_body "grant_type=refresh_token&refresh_token=$arg_token&client_id=$oidc_client&client_secret=$oidc_client_secret" ;
54+ proxy_set_body "grant_type=refresh_token&refresh_token=$arg_token&client_id=$oidc_client&state=$state& client_secret=$oidc_client_secret" ;
5555 proxy_method POST;
5656 proxy_pass $oidc_token_endpoint ;
5757 }
Original file line number Diff line number Diff line change @@ -43,6 +43,11 @@ map $host $oidc_hmac_key {
4343 default "ChangeMe" ;
4444}
4545
46+ map $host $state {
47+ # Unable to use this state if PKCE is enabled
48+ default 0;
49+ }
50+
4651map $proto $oidc_cookie_flags {
4752 http "Path=/; SameSite=lax;" ; # For HTTP/plaintext testing
4853 https "Path=/; SameSite=lax; HttpOnly; Secure;" ; # Production recommendation
You can’t perform that action at this time.
0 commit comments