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)

Reply

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.

Reply
Join the discussion
Create an account Log in

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

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

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