Skip to content

Commit 9ad63a3

Browse files
committed
FEATURE: Allow parameters to be passed from /auth/oidc to the IDP
The most common use case is when you want the IDP to start with a specific screen (e.g. signup, rather than sign in). This change has no effect by default, you must add the parameter names to the openid_connect_authorize_parameters site setting.
1 parent 67a5595 commit 9ad63a3

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

config/locales/server.en.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ en:
88
openid_connect_token_scope: "The scopes sent when requesting the token endpoint. The official specification does not require this."
99
openid_connect_error_redirects: "If the callback error_reason contains the first parameter, the user will be redirected to the URL in the second parameter"
1010
openid_connect_allow_association_change: "Allow users to disconnect and reconnect their Discourse accounts from the OpenID Connect provider"
11-
openid_connect_verbose_logging: "Log detailed openid-connect authentication information to `/logs`. Keep this disabled during normal use."
11+
openid_connect_verbose_logging: "Log detailed openid-connect authentication information to `/logs`. Keep this disabled during normal use."
12+
openid_connect_authorize_parameters: "URL parameters which will be included in the redirect from /auth/oidc to the IDP's authorize endpoint"

config/settings.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,7 @@ plugins:
1919
default: ''
2020
type: list
2121
list_type: secret
22+
openid_connect_authorize_parameters:
23+
default: ''
24+
type: list
25+
list_type: compact

lib/openid_connect_authenticator.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ def register_middleware(omniauth)
5050
scope: SiteSetting.openid_connect_authorize_scope,
5151
token_params: {
5252
scope: SiteSetting.openid_connect_token_scope,
53-
}
53+
},
54+
passthrough_authorize_options: SiteSetting.openid_connect_authorize_parameters.split("|")
5455
)
5556
}
5657
end

0 commit comments

Comments
 (0)