background preloader

Authentication & Rules

Facebook Twitter

Applicake/doorkeeper. Ryanb/cancan. Plataformatec/devise. OmniAuth: Overview · plataformatec/devise Wiki. Since version 1.2, Devise supports integration with OmniAuth. This wiki page will cover the basics to have this integration working using an OAuth provider as example. Since version 1.5, Devise supports OmniAuth 1.0 forward which will be the version covered by this tutorial. Before you start Remember that config.omniauth adds omniauth provider middleware to your application. This means you should not add this provider middleware again in config/initializers/omniauth.rb as they'll clash with each other and result in always-failing authentication.

Facebook example The first step then is to add an OmniAuth gem to your application. Gem 'omniauth-facebook' Here we'll use Facebook as an example, but you are free to use whatever and as many OmniAuth gems as you'd like. Next up, you should add the columns "provider" and "uid" to your User model. rails g migration AddColumnsToUsers provider uid rake db:migrate Next, you need to declare the provider in your config/initializers/devise.rb: Logout links.

Scambra/devise_invitable.