Besides the magic link, OAuth is another commonly used method to authenticate users.
OAuth is an authorization framework that allows users to grant third-party apps access to their data using services like Google, GitHub, or social media accounts without sharing their credentials.
In this lesson, we are going to demonstrate how to allow users to sign in using their GitHub account.
Registering an OAuth app on GitHub
The first thing you must do is to set up an OAuth app with GitHub. This tells GitHub that it is OK to share data with our SaaS application.
Go to Settings -> Developer Settings -> OAuth Apps, and click on the New OAuth app button.
You will be directed to the following page where you need to provide some information regarding your app.
The application name can be anything you want, and the homepage URL is the production URL for the app, which points to the homepage.
The authorization callback URL is the API endpoint within your SaaS platform, which allows GitHub to communicate with the app.