### Configuring Überauth Providers for Google (Elixir) Source: https://github.com/ueberauth/ueberauth_google/blob/master/README.md This configuration snippet shows how to register `Ueberauth.Strategy.Google` as a provider within your main Überauth setup. This tells Überauth to use the Google strategy when handling Google authentication requests. ```Elixir config :ueberauth, Ueberauth, providers: [ google: {Ueberauth.Strategy.Google, []} ] ``` -------------------------------- ### Defining Überauth Request and Callback Routes (Elixir) Source: https://github.com/ueberauth/ueberauth_google/blob/master/README.md This snippet provides the necessary Phoenix router configuration for handling Überauth authentication flows. It defines routes for initiating an authentication request and for receiving the callback response from the OAuth provider. ```Elixir scope "/auth", MyApp do pipe_through :browser get "/:provider", AuthController, :request get "/:provider/callback", AuthController, :callback end ``` -------------------------------- ### Adding Überauth Google Dependency to Mix.exs (Elixir) Source: https://github.com/ueberauth/ueberauth_google/blob/master/README.md This snippet demonstrates how to add the `ueberauth_google` dependency to your Elixir project's `mix.exs` file. This step is essential to make the Google OAuth2 strategy available for use within your application. ```Elixir def deps do [ {:ueberauth_google, "~> 0.10"} ] end ``` -------------------------------- ### Including Überauth Plug in Phoenix Controller (Elixir) Source: https://github.com/ueberauth/ueberauth_google/blob/master/README.md This code demonstrates how to include the `Ueberauth` plug in a Phoenix controller. By adding `plug Ueberauth`, the controller becomes capable of handling authentication requests and callbacks managed by Überauth. ```Elixir defmodule MyApp.AuthController do use MyApp.Web, :controller plug Ueberauth ... end ``` -------------------------------- ### Configuring Google OAuth Client ID/Secret (Run-time, Elixir) Source: https://github.com/ueberauth/ueberauth_google/blob/master/README.md This configuration method allows the Google OAuth client ID and secret to be read from environment variables at run time. This is beneficial for dynamic environments where credentials might change without requiring a recompile. ```Elixir config :ueberauth, Ueberauth.Strategy.Google.OAuth, client_id: {System, :get_env, ["GOOGLE_CLIENT_ID"]}, client_secret: {System, :get_env, ["GOOGLE_CLIENT_SECRET"]} ``` -------------------------------- ### Configuring Google OAuth Client ID/Secret (Compile-time, Elixir) Source: https://github.com/ueberauth/ueberauth_google/blob/master/README.md This snippet illustrates how to configure the Google OAuth client ID and secret by reading environment variables at compile time. This approach is suitable when environment variables are stable during application compilation. ```Elixir config :ueberauth, Ueberauth.Strategy.Google.OAuth, client_id: System.get_env("GOOGLE_CLIENT_ID"), client_secret: System.get_env("GOOGLE_CLIENT_SECRET") ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.