Skip to content

Commit 4a7de0b

Browse files
Fix issue initializing oidc-client
1 parent 4c859bb commit 4a7de0b

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

deps/rabbitmq_management/priv/www/js/oidc-oauth/helper.js

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ function auth_settings_apply_defaults(authSettings) {
7272
if (!resource_server.oauth_metadata_url) {
7373
resource_server.oauth_metadata_url = authSettings.metadata_url
7474
}
75+
if (!resource_server.oauth_authorization_endpoint_params) {
76+
resource_server.oauth_authorization_endpoint_params =
77+
authSettings.oauth_authorization_endpoint_params
78+
}
79+
if (!resource_server.oauth_token_endpoint_params) {
80+
resource_server.oauth_token_endpoint_params =
81+
authSettings.oauth_token_endpoint_params
82+
}
7583
resource_server.id = resource_server_id
7684
authSettings.resource_servers.push(resource_server)
7785
}
@@ -144,7 +152,7 @@ export function oidc_settings_from(resource_server) {
144152
redirect_uri: rabbit_base_uri() + "/js/oidc-oauth/login-callback.html",
145153
post_logout_redirect_uri: rabbit_base_uri() + "/",
146154
automaticSilentRenew: true,
147-
revokeAccessTokenOnSignout: true
155+
revokeAccessTokenOnSignout: true
148156
}
149157
if (resource_server.end_session_endpoint != "") {
150158
oidcSettings.metadataSeed = {
@@ -154,16 +162,16 @@ export function oidc_settings_from(resource_server) {
154162
if (resource_server.oauth_client_secret != "") {
155163
oidcSettings.client_secret = resource_server.oauth_client_secret
156164
}
157-
if (resource_server.authorization_endpoint_params != "") {
158-
oidcSettings.extraQueryParams = resource_server.authorization_endpoint_params
165+
if (resource_server.oauth_authorization_endpoint_params) {
166+
oidcSettings.extraQueryParams = resource_server.oauth_authorization_endpoint_params
159167
}
160-
if (resource_server.token_endpoint_params != "") {
161-
oidcSettings.extraTokenParams = resource_server.token_endpoint_params
168+
if (resource_server.oauth_token_endpoint_params) {
169+
oidcSettings.extraTokenParams = resource_server.oauth_token_endpoint_params
162170
}
163171
return oidcSettings
164172
}
165173

166-
function oauth_initialize_user_manager(resource_server) {
174+
function oauth_initialize_user_manager(resource_server) {
167175
oidc.Log.setLevel(oidc.Log.DEBUG);
168176
oidc.Log.setLogger(console);
169177

deps/rabbitmq_management/src/rabbit_mgmt_wm_auth.erl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ buildRootResourceServerIfAny(Id, Props) ->
103103
proplists:get_value(oauth_client_secret, Props)},
104104
{oauth_response_type,
105105
proplists:get_value(oauth_response_type, Props)},
106-
{authorization_endpoint_params,
107-
proplists:get_value(authorization_endpoint_params, Props)},
108-
{token_endpoint_params,
109-
proplists:get_value(token_endpoint_params, Props)}
106+
{oauth_authorization_endpoint_params,
107+
proplists:get_value(oauth_authorization_endpoint_params, Props)},
108+
{oauth_token_endpoint_params,
109+
proplists:get_value(oauth_token_endpoint_params, Props)}
110110
].
111111

112112
authSettings() ->

0 commit comments

Comments
 (0)