Skip to content

Commit c8f3011

Browse files
Support overriding state variable
1 parent db991ec commit c8f3011

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

openid_connect.js

+2-2
Original file line numberDiff line numberDiff 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+
}

openid_connect_configuration.conf

+5
Original file line numberDiff line numberDiff 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+
4651
map $proto $oidc_cookie_flags {
4752
http "Path=/; SameSite=lax;"; # For HTTP/plaintext testing
4853
https "Path=/; SameSite=lax; HttpOnly; Secure;"; # Production recommendation

0 commit comments

Comments
 (0)