Skip to content

Commit 983d5c9

Browse files
alanwilkie-finocompshawnhankim
authored andcommitted
Allow extra args to be provided to the OIDC auth endpoint
1 parent 2a2c0d8 commit 983d5c9

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

openid_connect.js

+4
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,10 @@ function getAuthZArgs(r) {
268268
var nonceHash = h.digest('base64url');
269269
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;
270270

271+
if (r.variables.oidc_authz_extra_args) {
272+
authZArgs += "&" + r.variables.oidc_authz_extra_args;
273+
}
274+
271275
r.headersOut['Set-Cookie'] = [
272276
"auth_redir=" + r.variables.request_uri + "; " + r.variables.oidc_cookie_flags,
273277
"auth_nonce=" + noncePlain + "; " + r.variables.oidc_cookie_flags

openid_connect_configuration.conf

+12
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@ map $host $oidc_authz_endpoint {
88
#www.example.com "https://my-idp/oauth2/v1/authorize";
99
}
1010

11+
map $host $oidc_authz_extra_args {
12+
# Extra arguments to include in the request to the IdP's authorization
13+
# endpoint.
14+
# Some IdPs provide extended capabilities controlled by extra arguments,
15+
# for example Keycloak can select an IdP to delegate to via the
16+
# "kc_idp_hint" argument.
17+
# Arguments must be expressed as query string parameters and URL-encoded
18+
# if required.
19+
default "";
20+
#www.example.com "kc_idp_hint=another_provider"
21+
}
22+
1123
map $host $oidc_token_endpoint {
1224
default "http://127.0.0.1:8080/auth/realms/master/protocol/openid-connect/token";
1325
}

0 commit comments

Comments
 (0)