Authentifyd

Devise + Omniauth Authentication encapsulated in an Engine. Uses Devise. Parts taken from perens-instant-user and sso-devise-omniauth-provider.

Setup

  • gem ‘authentifyd’

  • rake authentifyd:install:migrations

  • rake db:migrate

  • in config/routes.rb add:

    mount Authentifyd::Engine => "/#{your root for authentifyd}"
    * NB: don't mount Engine on root "/". This could be a feature added in the future but for the moment this possibility is not implemented.
    
  • Configure Devise: copy paste raw.github.com/plataformatec/devise/master/lib/generators/templates/devise.rb in config/initializers/devise.rb. Edit it.

    • NB: set “config.pepper”.

      ex: require 'securerandom' -> SecureRandom.hex(64)
      
  • Add Facebook and Twitter config files

    • Example

      staging:
        app_id: APP ID FOR STAGING ENV
        app_secret: APP SECRET FOR STAGING ENV
      development: &development
        app_id: APP ID FOR DEV ENV
        app_secret: APP SECRET FOR DEV ENV
      test:
        <<: *development
      

Customization

# if you want to override devise / authentifyd methods in the controller, use the provided load_hook

ActiveSupport.on_load :authentifyd_action_controller_extension do   
  # self: ActionController::Base   
end