All threads / What is the best way to handle omniauth
Ask A Question

Notifications

You’re not receiving notifications from this thread.

What is the best way to handle omniauth

Yashi EL asked in Gems / Libraries

Hi Chris, after couple of test run i figure out twitter is hard to work with other oauth2 providers, because twitter api doesn't allow to access other user email.. can you guide me about how to do this more efficiently with twitter. i like to use Twitter, Facebook, Google+, Dribbble, Behance, Azure AD and github auth modules and i'm using devise for the authorization. . also i'm planning to use separate module to have all the provider uids,

example,
user can have many providers (one-to-many)

That's one of the tricky situations you have to handle with Twitter. I need to do a screencast on this, but the idea is pretty simple and here's a link to check out in the meantime: http://sourcey.com/rails-4-omniauth-using-devise-with-twitter-facebook-and-linkedin/

Basically you setup the OAuth process as normal, but if the user goes through it and doesn't return an email address, you have the add in an additional step to gather their email address and/or password.

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 61,257+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

    © 2022 GoRails, LLC. All rights reserved.