Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 7d9665b28d
Fetching contributors…

Cannot retrieve contributors at this time

24 lines (19 sloc) 1.819 kB
Read the full article "Omniauth pure: Authentication with Facebook, Google, Google Apps, Twitter, Github, AOL, MyOpenID and many other OpenID providers" on CommunityGuides:
http://www.communityguides.eu/articles/16
This article will demonstrate how to set up a multi-provider authentication using the fabulous Omniauth gem. Users will be able to add multiple providers to their account and views for sign-in, sign-up and management of linked accounts are provided. The full source code is available on Github as a basis for your own projects.
Ruby on Rails CommunityGuides follows the purpose of giving back to open source - more specific, to the Rails community. It has been built to provide a basis to share knowledge on Ruby on Rails development. Developers from all over the world can share their knowledge easily and gain profit from the knowledge of other developers. All content is free and published under a Creative Commons license.
Credits:
Omniauth: http://github.com/intridea/omniauth
Omniauth Buttons: http://github.com/intridea/authbuttons
If you want to use Omniauth pure as a starting point in one of your applications, you just need to:
* add Omniauth to your gems
* generate a user model with whatever fields you like: rails generate model user name:string ...
* generate the service model: rails generate model service user_id:integer provider:string uid:string uname:string uemail:string
* generate the service controller: rails generate controller services
* set the secret for the cookie store in config/initializers/session_store!
* copy part of routes.rb
* copy the models service.rb and user.rb (or edit, if you already have a user model!)
* copy the code of the services_controller
* copy all views from services
* copy (parts of) the stylesheet
* and refer to the article for details...
Jump to Line
Something went wrong with that request. Please try again.