我正在关注本教程https://auth0.com/blog/elixir-and-phoenix-tutorial-build-an-authenticated-app/#Our-Phoenix-application-skeleton一切正常,直到我尝试运行它启用身份验证。现在我不断收到此错误:
** (RuntimeError) Expected to find settings under `config nil, Ueberauth.Strategy.Auth0.OAuth`, got nil. Check your config.exs.
这是我的 config.exs ...
1 # and its dependencies with the aid of the Mix.Config module.
2 #
3 # This configuration file is loaded before any dependency and
4 # is restricted to this project.
5
6 # General application configuration
7 use Mix.Config
8
9 config :countdown,
10 ecto_repos: [Countdown.Repo]
11
12 # Configures the endpoint
13 config :countdown, CountdownWeb.Endpoint,
14 url: [host: "localhost"],
15 secret_key_base: "bur+iF3WjRBI22r3j/Yzh4O3//lVXhSnpyVZKFjBllvBKv5Neyh1zQKsLDLZuB9K",
16 render_errors: [view: CountdownWeb.ErrorView, accepts: ~w(html json), layout: false],
17 pubsub_server: Countdown.PubSub,
18 live_view: [signing_salt: "waO+DlgX"]
19
20 # Configures Elixir's Logger
21 config :logger, :console,
22 format: "$time $metadata[$level] $message\n",
23 metadata: [:request_id]
24
25 # Use Jason for JSON parsing in Phoenix
26 config :phoenix, :json_library, Jason
27
28 # Configures Ueberauth
29 config :ueberauth, Ueberauth,
30 providers: [
31 auth0: {Ueberauth.Strategy.Auth0, []},
32 ]
33
34 # Import environment specific config. This must remain at the bottom
35 # of this file so it overrides the configuration defined above.
36 import_config "#{Mix.env()}.exs"
我也有...
+# Configures Ueberauth's Auth0 auth provider
+config :ueberauth, Ueberauth.Strategy.Auth0.OAuth,
+ domain: System.get_env("AUTH0_DOMAIN"),
+ client_id: System.get_env("AUTH0_CLIENT_ID"),
+ client_secret: System.get_env("AUTH0_CLIENT_SECRET")
在我的 config/dev.exs 文件中。
我意识到本教程已经很老了,但我找不到更新的东西。我查看了 Ueberauth_auth0 文档,他们提到您需要在启动应用程序之前启动 ueberauth_auth0。我对 Elixir/Phoenix 很陌生,我不确定这是否是问题或如何解决?根据教程、文档和 Ueberauth 示例应用程序,这似乎是我唯一缺少的东西。
有任何想法吗?