Skip to content

Commit

Permalink
Support overriding state variable
Browse files Browse the repository at this point in the history
  • Loading branch information
LakshanKarunathilake committed Feb 23, 2022
1 parent db991ec commit 0354c2c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions openid_connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ function getAuthZArgs(r) {

authZArgs += "&code_challenge_method=S256&code_challenge=" + pkce_code_challenge + "&state=" + r.variables.pkce_id;
} else {
authZArgs += "&state=0";
authZArgs += "&state=" + r.variables.state;
}
return authZArgs;
}
Expand All @@ -272,4 +272,4 @@ function idpClientAuth(r) {
} else {
return "code=" + r.variables.arg_code + "&client_secret=" + r.variables.oidc_client_secret;
}
}
}
6 changes: 6 additions & 0 deletions openid_connect_configuration.conf
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ map $host $oidc_hmac_key {
default "ChangeMe";
}

map $host $state {
# Unable to use this state if PKCE is enabled
default 0;
}


map $proto $oidc_cookie_flags {
http "Path=/; SameSite=lax;"; # For HTTP/plaintext testing
https "Path=/; SameSite=lax; HttpOnly; Secure;"; # Production recommendation
Expand Down

0 comments on commit 0354c2c

Please sign in to comment.