Skip to content

Commit 0f13cfd

Browse files
Fix bug
1 parent 2bd86a1 commit 0f13cfd

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

deps/oauth2_client/src/oauth2_client.erl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ get_access_token(OAuthProvider, Request) ->
3434
Type = ?CONTENT_URLENCODED,
3535
Body = build_access_token_request_body(Request),
3636
HTTPOptions =
37-
map_ssl_options_to_httpc_option(OAuthProvider) ++
37+
map_ssl_options_to_httpc_option(OAuthProvider#oauth_provider.ssl_options) ++
3838
map_timeout_to_httpc_option(Request#access_token_request.timeout),
3939
Response = http_post(URL, Header, Type, Body, HTTPOptions,
4040
OAuthProvider#oauth_provider.proxy_options),
@@ -129,7 +129,10 @@ drop_trailing_path_separator(Path) when is_list(Path) ->
129129
get_openid_configuration(DiscoverEndpoint, TLSOptions, ProxyOptions) ->
130130
rabbit_log:debug("get_openid_configuration from ~p (~p) [~p]", [DiscoverEndpoint,
131131
format_ssl_options(TLSOptions), format_proxy_options(ProxyOptions)]),
132-
Response = http_get(DiscoverEndpoint, TLSOptions, ProxyOptions),
132+
HTTPOptions =
133+
map_ssl_options_to_httpc_option(TLSOptions) ++
134+
map_timeout_to_httpc_option(?DEFAULT_HTTP_TIMEOUT),
135+
Response = http_get(DiscoverEndpoint, HTTPOptions, ProxyOptions),
133136
parse_openid_configuration_response(Response).
134137

135138
-spec merge_openid_configuration(openid_configuration(), oauth_provider()) ->

deps/rabbitmq_auth_backend_oauth2/test/rabbit_oauth2_provider_SUITE.erl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,13 @@ verify_provider() -> [
6565
]},
6666
{oauth_provider_with_issuer, [], [
6767
get_oauth_provider_has_jwks_uri
68-
]},
69-
{oauth_provider_with_proxy, [], [
68+
]}
69+
,{oauth_provider_with_proxy, [], [
7070
get_oauth_provider_has_proxy
71-
]},
72-
{oauth_provider_with_https_proxy, [], [
73-
get_oauth_provider_has_https_proxy
7471
]}
72+
% ,{oauth_provider_with_https_proxy, [], [
73+
% get_oauth_provider_has_https_proxy
74+
% ]}
7575
].
7676

7777
init_per_suite(Config) ->
@@ -467,6 +467,7 @@ get_oauth_provider_with_jwks_uri_returns_error(Config) ->
467467
?config(oauth_provider_id, Config), [jwks_uri]).
468468

469469
get_oauth_provider_has_jwks_uri(Config) ->
470+
ct:log("env vars: ~p", [application:get_all_env(rabbitmq_auth_backend_oauth2)]),
470471
{ok, OAuthProvider} = get_oauth_provider(
471472
?config(oauth_provider_id, Config), [jwks_uri]),
472473
?assertEqual(?config(jwks_uri, Config), OAuthProvider#oauth_provider.jwks_uri).

0 commit comments

Comments
 (0)