Use OmniAuth to Authenticate Using a Third Party
Learn how to use Devise or OmniAuth in Rails with a third party library.
We'll cover the following
OmniAuth is a Rails API for doing
It works by redirecting our users to the third-party site, having that site do the authentication, and then redirecting back to us. OmniAuth handles the specifics of integrating with each site that we choose to support (we can use as many different third parties as we want). See the figure below for more clarification on this.
Note that in step 5 (in the figure below), we will need to store some unique identifiers passed from the service to associate with the user in our app. We must take care of what we choose to use for this value. For example, users can change their email or username without necessarily changing their identity in our service.
Get hands-on with 1400+ tech skills courses.