iex(3)> data = Application.get_env(:foo, :openid_connect_providers)
[
xero: [
discovery_document_uri: "https://xero.com/identity/connect/authorize",
client_id: "XXXXXXXXXXXXXX",
client_secret: "XXXXXXXXXXXXXXXX",
redirect_uri: "https://localhost:5000/callback",
response_type: "code",
scope: "openid profile email accounting.transactions accounting.settings offline_access"
]
]
iex(4)> Op
OpenIDConnect OptionParser
iex(4)> OpenIDConnect.Worker.start_link(data)
** (EXIT from #PID<0.244.0>) shell process exited with reason: an exception was raised:
** (MatchError) no match of right hand side value: {:error, :update_documents, %HTTPoison.Response{body: "", headers: [{"Location", "https://login.xero.com/identity/error?errorId=CfDJ8LpFHpnPVChPv4tC90CFl2gluwXd6b3IIlvG2GKcHl44oDEIAl53dx2NcEerCHYDwbRtI8YNySzzpOt8RzKxqB7tjEbfwBsX1WItNDJvN0_TJ9M6S9XQdqNcNYws3VtoeMryooAMTnY861QiDCfFcDw0nlZVI1yLjUTxMrw1QusDO90Zcg528n9DqBSqp9waDyvFDQe6qgf1n2PzC5vrRjrC1eKTe2kuhWAqROmGFK7w_qI6HSnZ6FIFsdR_rv3ZBm-1AoGzp5dSHh8bkdOHeKXWqmNoN81d8RHxo8FAUriV"}, {"Content-Length", "0"}, {"Server", "nginx"}, {"Xero-Origin-Id", "IdentityServer.Web"}, {"Xero-Causation-Id", "1823bc07a0ad4a409afd6092ba1fa5d0"}, {"Xero-Message-Id", "e1887cf86a5148a1a43d990931ceb711"}, {"Xero-Activity-Id", "7646e119e551496aaea23c002d2d5700"}, {"Xero-Correlation-Id", "3daf7cd466ec456e9ef88ab9c97066fc"}, {"Date", "Mon, 13 Apr 2020 17:24:47 GMT"}, {"Connection", "keep-alive"}, {"Set-Cookie", "Device=4b1abc30cab148a6bbe21df7d69e3efc; expires=Sun, 13 Apr 2025 17:24:47 GMT; SameSite=none; path=/; HttpOnly"}, {"X-Client-IP", "7071"}, {"Set-Cookie", "bm_sz=07ABF453186821E1094E84FDF95BF8B8~YAAQH582Fx9xw2BxAQAAr3SSdAfOuGVqTqX16zyaT+U8+k5ueL0YxDFY0EzNYct5jVGcJXsUkD3gyZg8vnuLVCPwDf5ErKyq+vd8VmxDl9soosSpdWOYpi/CytwCeoA+8HmzSrf/kCrWCzqBoSWtjrVKmk6H0P15+dDn7jALyafPVIg+qPJXbkxCfFwpHg==; Domain=.xero.com; Path=/; Expires=Mon, 13 Apr 2020 21:24:46 GMT; Max-Age=14399; HttpOnly"}, {"Set-Cookie", "_abck=503013C1360ABA8EEDB9AAFFDA6E548C~-1~YAAQH582FyBxw2BxAQAAr3SSdAMP2GqP4k+8awVvS1uSh1r88id7yotCddej6DNgcDlzlE9gjBEKmueOoYGNHVLWhYTPmnH5yhONrP6eNbAWNH3gUFYLBUs4pW1c6AnaF4adlg4QkUX5ghGM6XqsmP08uRFxZ/w7qsgIIAXsJj6w4D1g1fkziphDAst7LBPN2cDER0msj9nWj15lGDv04oF9eaHHycw2nBlTx3sW5DdhYyoN+X1m+kVKSeHZZAkHDICNYX+98vfHIv+eCIFZv7Tr+XL3Q3sgYB9czwbJTI41BxO0GpTkXQ==~-1~-1~-1; Domain=.xero.com; Path=/; Expires=Tue, 13 Apr 2021 17:24:47 GMT; Max-Age=31536000; Secure"}], request: %HTTPoison.Request{body: "", headers: [], method: :get, options: [], params: %{}, url: "https://login.xero.com/identity/connect/authorize"}, request_url: "https://login.xero.com/identity/connect/authorize", status_code: 302}}
(openid_connect 0.2.2) lib/openid_connect/worker.ex:55: OpenIDConnect.Worker.update_documents/2
(openid_connect 0.2.2) lib/openid_connect/worker.ex:23: anonymous fn/1 in OpenIDConnect.Worker.init/1
(elixir 1.10.2) lib/enum.ex:1320: anonymous fn/4 in Enum.into/3
(elixir 1.10.2) lib/enum.ex:2111: Enum."-into/4-lists^foldl/2-0-"/3
(elixir 1.10.2) lib/enum.ex:2111: Enum.into/4
(openid_connect 0.2.2) lib/openid_connect/worker.ex:22: OpenIDConnect.Worker.init/1
(stdlib 3.9) gen_server.erl:374: :gen_server.init_it/2
(stdlib 3.9) gen_server.erl:342: :gen_server.init_it/6
Interactive Elixir (1.10.2) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)>
I think the openid_connect library is failing to start properly