Ueberauth

Oauth Callbacks

      {:ueberauth, "~> 0.10"},
      {:ueberauth_google, "~> 0.8"}

Setup

Config/config.exs

config :ueberauth, Ueberauth,
  providers: [
    google: {Ueberauth.Strategy.Google, []}
  ]
config :ueberauth, Ueberauth.Strategy.Google.OAuth,
  client_id: "[some_id].apps.googleusercontent.com",
  client_secret: "[some_secret]"

router.ex

  scope "/auth", ReactPhoenixWeb do
    pipe_through :browser

    get "/:provider", AuthController, :request
    get "/:provider/callback", AuthController, :callback
    post "/:provider/callback", AuthController, :callback
  end

controllers/auth_controller.ex

Last updated