I've used Devise as a standard authentication gem for other projects. In another project, I've used Devise + Omniauth for Twitter authentication.
In a new project I need my end users to be able to login via Twitter and Facebook or to be able to register via the app. In the future the user could link his accounts together. For example, his Twitter and Facebook account. Or, his Twitter and "native" account. "Native" being the account he registered with directly with the web app.
Is Devise capable of such? If so, how do we link the accounts of users together? What is the concept behind this? How does the app know which Facebook and Twitter account belong to which user?
Ideas and suggestions welcome.
EDIT:
I've been following http://railscasts.com/episodes/236-omniauth-part-2?autoplay=true and what i dont get is. If
- user is signed out of app,
- user has an account registered with app,
- user signs in with a different service provider (facebook, twitter, etc).
How does the app know how to link his new service provider with his already existing accounts?
Stackoverflow.com has this feature. But one service provider they are not including in their "multi-sign" on feature is Twitter. I'm guessing it's because Twitter doesn't expose the user's email through their API. While the other service providers (Facebook, Yahoo, Gmail) does.