I was following this tutorial https://auth0.com/blog/elixir-and-phoenix-tutorial-build-an-authenticated-app/#Our-Phoenix-application-skeleton and everything was working fine until I tried to run it with the auth enabled. Now I keep getting this error:
** (RuntimeError) Expected to find settings under `config nil, Ueberauth.Strategy.Auth0.OAuth`, got nil. Check your config.exs.
Here is my 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"
I also have...
+# 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")
in my config/dev.exs file.
I realize that this tutorial is very old but I couldn't find anything more recent. I looked at the Ueberauth_auth0 docs and they mention that you need to start ueberauth_auth0 before you start your application. I'm pretty new to Elixir/Phoenix and I'm not sure if that could be the issue or how to solve it? That seems to be the only thing that I am missing based on the tutorial, docs, and Ueberauth example app.
Any ideas?