Integrating Google Sign-In with Phoenix LiveView

Integrating Google Sign-In with Phoenix LiveView

Source: chriis.dev

Type: Post

The article breaks down the steps necessary to integrate Google authentication into a LiveView application. Members of the Elixir community familiar with Phoenix's `phx.gen.auth` generator will find the process straightforward. To begin, you'll need a Google project and credentials from Google Cloud Platform. With these at hand, the addition of ueberauth and ueberauth_google dependencies allows for the configuration of OAuth settings in your `config.exs` file using the secrets obtained from Google. The implementation requires an update to your user schema and relevant controllers to handle redirection callbacks and user session management. The final touches include updating the router and adding authentication triggers in the UI. Upon completion, your Phoenix LiveView application will have a seamless sign-up and login flow using Google services.

© HashMerge 2024