@@ -48,7 +48,7 @@ function auth(r, afterSyncCheck) {
4848 return ;
4949 }
5050 // Redirect the client to the IdP login page with the cookies we need for state
51- r . return ( 302 , r . variables . oidc_authz_endpoint + getAuthZArgs ( r ) ) ;
51+ r . return ( 302 , r . variables . oidc_authz_endpoint + getQueryParamsAuthZ ( r ) ) ;
5252 return ;
5353 }
5454
@@ -260,16 +260,16 @@ function logout(r) {
260260 r . return ( 302 , r . variables . oidc_logout_redirect ) ;
261261}
262262
263- function getAuthZArgs ( r ) {
263+ function getQueryParamsAuthZ ( r ) {
264264 // Choose a nonce for this flow for the client, and hash it for the IdP
265265 var noncePlain = r . variables . request_id ;
266266 var c = require ( 'crypto' ) ;
267267 var h = c . createHmac ( 'sha256' , r . variables . oidc_hmac_key ) . update ( noncePlain ) ;
268268 var nonceHash = h . digest ( 'base64url' ) ;
269- var authZArgs = "?response_type=code&scope=" + r . variables . oidc_scopes + "&client_id=" + r . variables . oidc_client + "&redirect_uri=" + r . variables . redirect_base + r . variables . redir_location + "&nonce=" + nonceHash ;
269+ var queryParams = "?response_type=code&scope=" + r . variables . oidc_scopes + "&client_id=" + r . variables . oidc_client + "&redirect_uri=" + r . variables . redirect_base + r . variables . redir_location + "&nonce=" + nonceHash ;
270270
271- if ( r . variables . oidc_authz_extra_args ) {
272- authZArgs += "&" + r . variables . oidc_authz_extra_args ;
271+ if ( r . variables . oidc_authz_extra_query_params ) {
272+ queryParams += "&" + r . variables . oidc_authz_extra_query_params ;
273273 }
274274
275275 r . headersOut [ 'Set-Cookie' ] = [
@@ -283,11 +283,11 @@ function getAuthZArgs(r) {
283283 var pkce_code_challenge = c . createHash ( 'sha256' ) . update ( pkce_code_verifier ) . digest ( 'base64url' ) ;
284284 r . variables . pkce_code_verifier = pkce_code_verifier ;
285285
286- authZArgs += "&code_challenge_method=S256&code_challenge=" + pkce_code_challenge + "&state=" + r . variables . pkce_id ;
286+ queryParams += "&code_challenge_method=S256&code_challenge=" + pkce_code_challenge + "&state=" + r . variables . pkce_id ;
287287 } else {
288- authZArgs += "&state=0" ;
288+ queryParams += "&state=0" ;
289289 }
290- return authZArgs ;
290+ return queryParams ;
291291}
292292
293293function idpClientAuth ( r ) {
0 commit comments