@@ -48,7 +48,7 @@ function auth(r, afterSyncCheck) {
48
48
return ;
49
49
}
50
50
// 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 ) ) ;
52
52
return ;
53
53
}
54
54
@@ -271,16 +271,16 @@ function logout(r) {
271
271
r . return ( 302 , r . variables . oidc_logout_redirect ) ;
272
272
}
273
273
274
- function getAuthZArgs ( r ) {
274
+ function getQueryParamsAuthZ ( r ) {
275
275
// Choose a nonce for this flow for the client, and hash it for the IdP
276
276
var noncePlain = r . variables . request_id ;
277
277
var c = require ( 'crypto' ) ;
278
278
var h = c . createHmac ( 'sha256' , r . variables . oidc_hmac_key ) . update ( noncePlain ) ;
279
279
var nonceHash = h . digest ( 'base64url' ) ;
280
- 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 ;
280
+ 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 ;
281
281
282
- if ( r . variables . oidc_authz_extra_args ) {
283
- authZArgs += "&" + r . variables . oidc_authz_extra_args ;
282
+ if ( r . variables . oidc_authz_extra_query_params ) {
283
+ queryParams += "&" + r . variables . oidc_authz_extra_query_params ;
284
284
}
285
285
286
286
r . headersOut [ 'Set-Cookie' ] = [
@@ -294,11 +294,11 @@ function getAuthZArgs(r) {
294
294
var pkce_code_challenge = c . createHash ( 'sha256' ) . update ( pkce_code_verifier ) . digest ( 'base64url' ) ;
295
295
r . variables . pkce_code_verifier = pkce_code_verifier ;
296
296
297
- authZArgs += "&code_challenge_method=S256&code_challenge=" + pkce_code_challenge + "&state=" + r . variables . pkce_id ;
297
+ queryParams += "&code_challenge_method=S256&code_challenge=" + pkce_code_challenge + "&state=" + r . variables . pkce_id ;
298
298
} else {
299
- authZArgs += "&state=0" ;
299
+ queryParams += "&state=0" ;
300
300
}
301
- return authZArgs ;
301
+ return queryParams ;
302
302
}
303
303
304
304
function idpClientAuth ( r ) {
0 commit comments