diff --git a/README.md b/README.md index f337270..4e3a85c 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,7 @@ init(_Args) -> ```elixir {:ok, _pid} = Oidcc.ProviderConfiguration.Worker.start_link(%{ - issuer: "https://accounts.google.com/", + issuer: "https://accounts.google.com", name: Myapp.OidccConfigProvider }) ``` diff --git a/lib/oidcc.ex b/lib/oidcc.ex index 9273e3d..092057c 100644 --- a/lib/oidcc.ex +++ b/lib/oidcc.ex @@ -6,14 +6,14 @@ defmodule Oidcc do {:ok, _pid} = Oidcc.ProviderConfiguration.Worker.start_link(%{ - issuer: "https://accounts.google.com/", + issuer: "https://accounts.google.com", name: MyApp.GoogleConfigProvider }) or via a supervisor Supervisor.init([ - {Oidcc.ProviderConfiguration.Worker, %{issuer: "https://accounts.google.com/"}} + {Oidcc.ProviderConfiguration.Worker, %{issuer: "https://accounts.google.com"}} ], strategy: :one_for_one) ## Global Configuration @@ -30,7 +30,7 @@ defmodule Oidcc do iex> {:ok, pid} = ...> Oidcc.ProviderConfiguration.Worker.start_link(%{ - ...> issuer: "https://accounts.google.com/" + ...> issuer: "https://accounts.google.com" ...> }) ...> ...> {:ok, _redirect_uri} = @@ -65,7 +65,7 @@ defmodule Oidcc do iex> {:ok, pid} = ...> Oidcc.ProviderConfiguration.Worker.start_link(%{ - ...> issuer: "https://login.yahoo.com" + ...> issuer: "https://api.login.yahoo.com" ...> }) ...> ...> # Get auth_code fromm redirect @@ -108,7 +108,7 @@ defmodule Oidcc do iex> {:ok, pid} = ...> Oidcc.ProviderConfiguration.Worker.start_link(%{ - ...> issuer: "https://login.yahoo.com" + ...> issuer: "https://api.login.yahoo.com" ...> }) ...> ...> # Get refresh_token fromm redirect @@ -164,7 +164,7 @@ defmodule Oidcc do iex> {:ok, pid} = ...> Oidcc.ProviderConfiguration.Worker.start_link(%{ - ...> issuer: "https://login.yahoo.com" + ...> issuer: "https://api.login.yahoo.com" ...> }) ...> ...> Oidcc.introspect_token( @@ -218,7 +218,7 @@ defmodule Oidcc do iex> {:ok, pid} = ...> Oidcc.ProviderConfiguration.Worker.start_link(%{ - ...> issuer: "https://login.yahoo.com" + ...> issuer: "https://api.login.yahoo.com" ...> }) ...> ...> # Get access_token from Oidcc.Token.retrieve/3 diff --git a/lib/oidcc/authorization.ex b/lib/oidcc/authorization.ex index d0322c6..b869368 100644 --- a/lib/oidcc/authorization.ex +++ b/lib/oidcc/authorization.ex @@ -16,7 +16,7 @@ defmodule Oidcc.Authorization do iex> {:ok, pid} = ...> Oidcc.ProviderConfiguration.Worker.start_link(%{ - ...> issuer: "https://accounts.google.com/" + ...> issuer: "https://accounts.google.com" ...> }) ...> ...> {:ok, client_context} = diff --git a/lib/oidcc/client_context.ex b/lib/oidcc/client_context.ex index ba6b9e9..3fff3e6 100644 --- a/lib/oidcc/client_context.ex +++ b/lib/oidcc/client_context.ex @@ -31,7 +31,7 @@ defmodule Oidcc.ClientContext do iex> {:ok, pid} = ...> Oidcc.ProviderConfiguration.Worker.start_link(%{ - ...> issuer: "https://accounts.google.com/", + ...> issuer: "https://accounts.google.com", ...> name: __MODULE__.GoogleConfigProvider ...> }) ...> diff --git a/lib/oidcc/provider_configuration/worker.ex b/lib/oidcc/provider_configuration/worker.ex index 699f713..99aeaac 100644 --- a/lib/oidcc/provider_configuration/worker.ex +++ b/lib/oidcc/provider_configuration/worker.ex @@ -8,7 +8,7 @@ defmodule Oidcc.ProviderConfiguration.Worker do ```elixir Supervisor.init([ - {Oidcc.ProviderConfiguration.Worker, %{issuer: "https://accounts.google.com/"}} + {Oidcc.ProviderConfiguration.Worker, %{issuer: "https://accounts.google.com"}} ], strategy: :one_for_one) ``` """ @@ -33,7 +33,7 @@ defmodule Oidcc.ProviderConfiguration.Worker do iex> {:ok, _pid} = ...> Oidcc.ProviderConfiguration.Worker.start_link(%{ - ...> issuer: "https://accounts.google.com/", + ...> issuer: "https://accounts.google.com", ...> name: __MODULE__.GoogleConfigProvider ...> }) """ @@ -64,7 +64,7 @@ defmodule Oidcc.ProviderConfiguration.Worker do iex> {:ok, pid} = ...> Oidcc.ProviderConfiguration.Worker.start_link(%{ - ...> issuer: "https://accounts.google.com/" + ...> issuer: "https://accounts.google.com" ...> }) ...> %Oidcc.ProviderConfiguration{issuer: "https://accounts.google.com"} = ...> Oidcc.ProviderConfiguration.Worker.get_provider_configuration(pid) @@ -84,7 +84,7 @@ defmodule Oidcc.ProviderConfiguration.Worker do iex> {:ok, pid} = ...> Oidcc.ProviderConfiguration.Worker.start_link(%{ - ...> issuer: "https://accounts.google.com/" + ...> issuer: "https://accounts.google.com" ...> }) ...> %JOSE.JWK{} = ...> Oidcc.ProviderConfiguration.Worker.get_jwks(pid) @@ -104,7 +104,7 @@ defmodule Oidcc.ProviderConfiguration.Worker do iex> {:ok, pid} = ...> Oidcc.ProviderConfiguration.Worker.start_link(%{ - ...> issuer: "https://accounts.google.com/" + ...> issuer: "https://accounts.google.com" ...> }) ...> :ok = Oidcc.ProviderConfiguration.Worker.refresh_configuration(pid) """ @@ -120,7 +120,7 @@ defmodule Oidcc.ProviderConfiguration.Worker do iex> {:ok, pid} = ...> Oidcc.ProviderConfiguration.Worker.start_link(%{ - ...> issuer: "https://accounts.google.com/" + ...> issuer: "https://accounts.google.com" ...> }) ...> :ok = Oidcc.ProviderConfiguration.Worker.refresh_jwks(pid) """ @@ -136,7 +136,7 @@ defmodule Oidcc.ProviderConfiguration.Worker do iex> {:ok, pid} = ...> Oidcc.ProviderConfiguration.Worker.start_link(%{ - ...> issuer: "https://accounts.google.com/" + ...> issuer: "https://accounts.google.com" ...> }) ...> :ok = Oidcc.ProviderConfiguration.Worker.refresh_jwks_for_unknown_kid(pid, "kid") """ diff --git a/lib/oidcc/token.ex b/lib/oidcc/token.ex index ad9762b..a9dcbf3 100644 --- a/lib/oidcc/token.ex +++ b/lib/oidcc/token.ex @@ -126,7 +126,7 @@ defmodule Oidcc.Token do iex> {:ok, pid} = ...> Oidcc.ProviderConfiguration.Worker.start_link(%{ - ...> issuer: "https://login.yahoo.com" + ...> issuer: "https://api.login.yahoo.com" ...> }) ...> ...> {:ok, client_context} = @@ -172,7 +172,7 @@ defmodule Oidcc.Token do iex> {:ok, pid} = ...> Oidcc.ProviderConfiguration.Worker.start_link(%{ - ...> issuer: "https://login.yahoo.com" + ...> issuer: "https://api.login.yahoo.com" ...> }) ...> ...> {:ok, client_context} = @@ -228,7 +228,7 @@ defmodule Oidcc.Token do iex> {:ok, pid} = ...> Oidcc.ProviderConfiguration.Worker.start_link(%{ - ...> issuer: "https://login.yahoo.com" + ...> issuer: "https://api.login.yahoo.com" ...> }) ...> ...> {:ok, client_context} = diff --git a/lib/oidcc/token_introspection.ex b/lib/oidcc/token_introspection.ex index 73ad0b2..5209f52 100644 --- a/lib/oidcc/token_introspection.ex +++ b/lib/oidcc/token_introspection.ex @@ -60,7 +60,7 @@ defmodule Oidcc.TokenIntrospection do iex> {:ok, pid} = ...> Oidcc.ProviderConfiguration.Worker.start_link(%{ - ...> issuer: "https://login.yahoo.com" + ...> issuer: "https://api.login.yahoo.com" ...> }) ...> ...> {:ok, client_context} = diff --git a/lib/oidcc/userinfo.ex b/lib/oidcc/userinfo.ex index 0832766..99d17f7 100644 --- a/lib/oidcc/userinfo.ex +++ b/lib/oidcc/userinfo.ex @@ -46,7 +46,7 @@ defmodule Oidcc.Userinfo do iex> {:ok, pid} = ...> Oidcc.ProviderConfiguration.Worker.start_link(%{ - ...> issuer: "https://login.yahoo.com" + ...> issuer: "https://api.login.yahoo.com" ...> }) ...> ...> {:ok, client_context} = diff --git a/src/oidcc_provider_configuration.erl b/src/oidcc_provider_configuration.erl index 48025f8..9445fc0 100644 --- a/src/oidcc_provider_configuration.erl +++ b/src/oidcc_provider_configuration.erl @@ -119,6 +119,7 @@ | alg_no_none, Field :: atom() }} + | {issuer_mismatch, Issuer :: binary()} | oidcc_http_util:error(). -define(DEFAULT_CONFIG_EXPIRY, timer:minutes(15)). @@ -180,7 +181,8 @@ when Issuer :: uri_string:uri_string(), Opts :: opts(). -load_configuration(Issuer, Opts) -> +load_configuration(Issuer0, Opts) -> + Issuer = binary:list_to_bin([Issuer0]), TelemetryOpts = #{topic => [oidcc, load_configuration], extra_meta => #{issuer => Issuer}}, RequestOpts = maps:get(request_opts, Opts, #{}), Request = {[Issuer, <<"/.well-known/openid-configuration">>], []}, @@ -188,9 +190,11 @@ load_configuration(Issuer, Opts) -> maybe {ok, {{json, ConfigurationMap}, Headers}} ?= oidcc_http_util:request(get, Request, TelemetryOpts, RequestOpts), Expiry = headers_to_deadline(Headers, Opts), - {ok, Configuration} ?= decode_configuration(ConfigurationMap), + {ok, #oidcc_provider_configuration{issuer = Issuer} = Configuration} + ?= decode_configuration(ConfigurationMap), {ok, {Configuration, Expiry}} else + {ok, #oidcc_provider_configuration{issuer = DifferentIssuer}} -> {error, {issuer_mismatch, DifferentIssuer}}; {error, Reason} -> {error, Reason}; {ok, {{_Format, _Body}, _Headers}} -> {error, invalid_content_type} end. diff --git a/src/oidcc_provider_configuration_worker.erl b/src/oidcc_provider_configuration_worker.erl index 2a67b99..d6f3e9c 100644 --- a/src/oidcc_provider_configuration_worker.erl +++ b/src/oidcc_provider_configuration_worker.erl @@ -220,7 +220,15 @@ get_jwks(Name) -> %% @since 3.0.0 -spec refresh_configuration(Name :: gen_server:server_ref()) -> ok. refresh_configuration(Name) -> - gen_server:cast(Name, refresh_configuration). + refresh_configuration(Name, true). + +-spec refresh_configuration(Name :: gen_server:server_ref(), Synchronous :: boolean()) -> ok. +refresh_configuration(Name, false) -> + gen_server:cast(Name, refresh_configuration); +refresh_configuration(Name, true) -> + refresh_configuration(Name, false), + gen_server:call(Name, get_provider_configuration), + ok. %% @doc Refresh JWKs %% @@ -239,8 +247,15 @@ refresh_configuration(Name) -> %% @end %% @since 3.0.0 -spec refresh_jwks(Name :: gen_server:server_ref()) -> ok. -refresh_jwks(Name) -> - gen_server:cast(Name, refresh_jwks). +refresh_jwks(Name) -> refresh_jwks(Name, true). + +-spec refresh_jwks(Name :: gen_server:server_ref(), Synchronous :: boolean()) -> ok. +refresh_jwks(Name, false) -> + gen_server:cast(Name, refresh_jwks); +refresh_jwks(Name, true) -> + refresh_jwks(Name, false), + gen_server:call(Name, get_jwks), + ok. %% @doc Refresh JWKs if the provided `Kid' is not matching any currently loaded keys %% @@ -259,7 +274,18 @@ refresh_jwks(Name) -> -spec refresh_jwks_for_unknown_kid(Name :: gen_server:server_ref(), Kid :: binary()) -> ok. refresh_jwks_for_unknown_kid(Name, Kid) -> - gen_server:cast(Name, {refresh_jwks_for_unknown_kid, Kid}). + refresh_jwks_for_unknown_kid(Name, Kid, true). + +-spec refresh_jwks_for_unknown_kid( + Name :: gen_server:server_ref(), Kid :: binary(), Synchronous :: boolean() +) -> + ok. +refresh_jwks_for_unknown_kid(Name, Kid, false) -> + gen_server:cast(Name, {refresh_jwks_for_unknown_kid, Kid}); +refresh_jwks_for_unknown_kid(Name, Kid, true) -> + refresh_jwks_for_unknown_kid(Name, Kid, false), + gen_server:call(Name, get_jwks), + ok. -spec get_issuer(Opts :: opts()) -> {ok, binary()} | {error, issuer_required}. get_issuer(Opts) -> diff --git a/test/oidcc/authorization_test.exs b/test/oidcc/authorization_test.exs index b988ede..be62922 100644 --- a/test/oidcc/authorization_test.exs +++ b/test/oidcc/authorization_test.exs @@ -9,7 +9,7 @@ defmodule Oidcc.AuthorizationTest do test "works" do pid = start_supervised!( - {Oidcc.ProviderConfiguration.Worker, %{issuer: "https://accounts.google.com/"}} + {Oidcc.ProviderConfiguration.Worker, %{issuer: "https://accounts.google.com"}} ) {:ok, client_context} = diff --git a/test/oidcc/client_context_test.exs b/test/oidcc/client_context_test.exs index a5d5327..1965be7 100644 --- a/test/oidcc/client_context_test.exs +++ b/test/oidcc/client_context_test.exs @@ -10,7 +10,7 @@ defmodule Oidcc.ClientContextTest do pid = start_supervised!( {Oidcc.ProviderConfiguration.Worker, - %{issuer: "https://accounts.google.com/", name: __MODULE__.GoogleProvider}} + %{issuer: "https://accounts.google.com", name: __MODULE__.GoogleProvider}} ) assert {:ok, %Oidcc.ClientContext{}} = diff --git a/test/oidcc/provider_configuration/worker_test.exs b/test/oidcc/provider_configuration/worker_test.exs index c3eb7b0..bfe3caf 100644 --- a/test/oidcc/provider_configuration/worker_test.exs +++ b/test/oidcc/provider_configuration/worker_test.exs @@ -9,7 +9,7 @@ defmodule Oidcc.ProviderConfiguration.WorkerTest do describe inspect(&Worker.start_link/1) do test "works" do start_supervised!( - {Worker, %{issuer: "https://accounts.google.com/", name: __MODULE__.GoogleProvider}} + {Worker, %{issuer: "https://accounts.google.com", name: __MODULE__.GoogleProvider}} ) end end @@ -18,7 +18,7 @@ defmodule Oidcc.ProviderConfiguration.WorkerTest do test "works" do pid = start_supervised!( - {Worker, %{issuer: "https://accounts.google.com/", name: __MODULE__.GoogleProvider}} + {Worker, %{issuer: "https://accounts.google.com", name: __MODULE__.GoogleProvider}} ) assert %ProviderConfiguration{issuer: "https://accounts.google.com"} = @@ -29,7 +29,7 @@ defmodule Oidcc.ProviderConfiguration.WorkerTest do describe inspect(&Worker.get_jwks/1) do test "works" do start_supervised!( - {Worker, %{issuer: "https://accounts.google.com/", name: __MODULE__.GoogleProvider}} + {Worker, %{issuer: "https://accounts.google.com", name: __MODULE__.GoogleProvider}} ) assert %JOSE.JWK{} = @@ -41,7 +41,7 @@ defmodule Oidcc.ProviderConfiguration.WorkerTest do test "works" do pid = start_supervised!( - {Worker, %{issuer: "https://accounts.google.com/", name: __MODULE__.GoogleProvider}} + {Worker, %{issuer: "https://accounts.google.com", name: __MODULE__.GoogleProvider}} ) assert :ok = Worker.refresh_configuration(pid) @@ -52,7 +52,7 @@ defmodule Oidcc.ProviderConfiguration.WorkerTest do test "works" do pid = start_supervised!( - {Worker, %{issuer: "https://accounts.google.com/", name: __MODULE__.GoogleProvider}} + {Worker, %{issuer: "https://accounts.google.com", name: __MODULE__.GoogleProvider}} ) assert :ok = Worker.refresh_jwks(pid) @@ -63,7 +63,7 @@ defmodule Oidcc.ProviderConfiguration.WorkerTest do test "works" do pid = start_supervised!( - {Worker, %{issuer: "https://accounts.google.com/", name: __MODULE__.GoogleProvider}} + {Worker, %{issuer: "https://accounts.google.com", name: __MODULE__.GoogleProvider}} ) assert :ok = Worker.refresh_jwks_for_unknown_kid(pid, "kid") diff --git a/test/oidcc_client_context_SUITE.erl b/test/oidcc_client_context_SUITE.erl index dc8b8ac..cd4f6df 100644 --- a/test/oidcc_client_context_SUITE.erl +++ b/test/oidcc_client_context_SUITE.erl @@ -13,7 +13,7 @@ all() -> from_configuration_worker(_Config) -> {ok, GoogleConfigurationPid} = oidcc_provider_configuration_worker:start_link(#{ - issuer => <<"https://accounts.google.com/">>, + issuer => <<"https://accounts.google.com">>, name => {local, from_configuration_worker_oidcc_client_context_SUITE} }), diff --git a/test/oidcc_provider_configuration_SUITE.erl b/test/oidcc_provider_configuration_SUITE.erl index f93ca0b..528ba88 100644 --- a/test/oidcc_provider_configuration_SUITE.erl +++ b/test/oidcc_provider_configuration_SUITE.erl @@ -2,6 +2,7 @@ -export([all/0]). -export([load_configuration/1]). +-export([load_configuration_issuer_mismatch/1]). -export([load_jwks/1]). -export([load_well_known_openid_introspections/1]). -export([reads_configuration_expiry/1]). @@ -14,6 +15,7 @@ all() -> [ load_configuration, + load_configuration_issuer_mismatch, load_jwks, reads_configuration_expiry, load_well_known_openid_introspections @@ -28,6 +30,15 @@ load_configuration(_Config) -> }, 3_600_000 }}, + oidcc_provider_configuration:load_configuration( + <<"https://accounts.google.com">>, + #{} + ) + ). + +load_configuration_issuer_mismatch(_Config) -> + ?assertMatch( + {error, {issuer_mismatch, <<"https://accounts.google.com">>}}, oidcc_provider_configuration:load_configuration( <<"https://accounts.google.com/">>, #{} @@ -45,9 +56,9 @@ load_jwks(_Config) -> reads_configuration_expiry(_Config) -> ?assertMatch( - {ok, {#oidcc_provider_configuration{}, 86_400_000}}, + {ok, {#oidcc_provider_configuration{}, 3_600_000}}, oidcc_provider_configuration:load_configuration( - <<"https://login.microsoftonline.com/common/v2.0">>, + <<"https://accounts.google.com">>, #{} ) ). @@ -66,7 +77,7 @@ load_well_known_openid_introspections(_Config) -> ?assertMatch( {ok, {#oidcc_provider_configuration{}, _}}, oidcc_provider_configuration:load_configuration( - <<"https://login.yahoo.com">>, + <<"https://api.login.yahoo.com">>, #{} ) ), @@ -84,7 +95,7 @@ load_well_known_openid_introspections(_Config) -> ?assertMatch( {ok, {#oidcc_provider_configuration{}, _}}, oidcc_provider_configuration:load_configuration( - <<"https://iam-test.indigo-datacloud.eu">>, + <<"https://iam-test.indigo-datacloud.eu/">>, #{} ) ), @@ -93,7 +104,7 @@ load_well_known_openid_introspections(_Config) -> ?assertMatch( {ok, {#oidcc_provider_configuration{}, _}}, oidcc_provider_configuration:load_configuration( - <<"https://services.humanbrainproject.eu/oidc">>, + <<"https://services.humanbrainproject.eu/oidc/">>, #{} ) ), diff --git a/test/oidcc_provider_configuration_worker_SUITE.erl b/test/oidcc_provider_configuration_worker_SUITE.erl index 0a07508..64ed2ae 100644 --- a/test/oidcc_provider_configuration_worker_SUITE.erl +++ b/test/oidcc_provider_configuration_worker_SUITE.erl @@ -35,7 +35,7 @@ retrieves_configuration(_Config) -> {ok, GoogleConfigurationPid} = oidcc_provider_configuration_worker:start_link(#{ - issuer => <<"https://accounts.google.com/">>, + issuer => <<"https://accounts.google.com">>, name => {local, WorkerName} }), @@ -62,7 +62,7 @@ retrieves_configuration(_Config) -> receive {[oidcc, load_configuration, start], TelemetryRef, #{}, #{ - issuer := <<"https://accounts.google.com/">> + issuer := <<"https://accounts.google.com">> }} -> ok after 10_000 -> @@ -71,7 +71,7 @@ retrieves_configuration(_Config) -> receive {[oidcc, load_configuration, stop], TelemetryRef, #{duration := _Duration}, #{ - issuer := <<"https://accounts.google.com/">> + issuer := <<"https://accounts.google.com">> }} -> ok after 10_000 -> @@ -88,7 +88,7 @@ retrieves_configuration(_Config) -> retrieves_jwks(_Config) -> {ok, GoogleConfigurationPid} = oidcc_provider_configuration_worker:start_link(#{ - issuer => <<"https://accounts.google.com/">> + issuer => <<"https://accounts.google.com">> }), ?assertMatch( @@ -130,7 +130,7 @@ retrieves_jwks(_Config) -> refreshes_jwks_on_missing_kid(_Config) -> {ok, GoogleConfigurationPid} = oidcc_provider_configuration_worker:start_link(#{ - issuer => <<"https://accounts.google.com/">> + issuer => <<"https://accounts.google.com">> }), #jose_jwk{ @@ -172,7 +172,7 @@ refreshes_jwks_on_missing_kid(_Config) -> refreshes_after_timeout(_Config) -> {ok, YahooConfigurationPid} = oidcc_provider_configuration_worker:start_link(#{ - issuer => <<"https://login.yahoo.com">>, + issuer => <<"https://api.login.yahoo.com">>, provider_configuration_opts => #{fallback_expiry => 100} }), diff --git a/test/oidcc_test.exs b/test/oidcc_test.exs index edee7ba..e569841 100644 --- a/test/oidcc_test.exs +++ b/test/oidcc_test.exs @@ -37,7 +37,7 @@ defmodule OidccTest do test "works" do pid = start_supervised!( - {ProviderConfiguration.Worker, %{issuer: "https://accounts.google.com/"}} + {ProviderConfiguration.Worker, %{issuer: "https://accounts.google.com"}} ) assert {:ok, _redirect_uri} = @@ -54,7 +54,7 @@ defmodule OidccTest do test "works" do pid = start_supervised!( - {ProviderConfiguration.Worker, %{issuer: "https://accounts.google.com/"}} + {ProviderConfiguration.Worker, %{issuer: "https://accounts.google.com"}} ) assert {:error, {:http_error, 400, _body}} = @@ -72,7 +72,7 @@ defmodule OidccTest do test "works" do pid = start_supervised!( - {ProviderConfiguration.Worker, %{issuer: "https://accounts.google.com/"}} + {ProviderConfiguration.Worker, %{issuer: "https://accounts.google.com"}} ) assert {:error, {:http_error, 401, _body}} = @@ -97,7 +97,9 @@ defmodule OidccTest do describe inspect(&Oidcc.introspect_token/5) do test "works" do pid = - start_supervised!({ProviderConfiguration.Worker, %{issuer: "https://login.yahoo.com"}}) + start_supervised!( + {ProviderConfiguration.Worker, %{issuer: "https://api.login.yahoo.com"}} + ) assert {:error, {:http_error, 400, _body}} = Oidcc.introspect_token( @@ -120,7 +122,9 @@ defmodule OidccTest do describe inspect(&Oidcc.retrieve_userinfo/5) do test "works" do pid = - start_supervised!({ProviderConfiguration.Worker, %{issuer: "https://login.yahoo.com"}}) + start_supervised!( + {ProviderConfiguration.Worker, %{issuer: "https://api.login.yahoo.com"}} + ) assert {:error, {:http_error, 401, _body}} = Oidcc.retrieve_userinfo(