Skip to content

Instantly share code, notes, and snippets.

@pablomarti
Created March 26, 2013 04:21
Show Gist options
  • Save pablomarti/5243118 to your computer and use it in GitHub Desktop.
Save pablomarti/5243118 to your computer and use it in GitHub Desktop.
Use OmniAuth middleware with Facebook inside of an engine. Example: https://github.com/pablomarti/simple_user/blob/master/lib/simple_user/engine.rb
module SimpleUser
require 'rubygems'
require 'omniauth'
require 'omniauth-facebook'
class Engine < ::Rails::Engine
isolate_namespace SimpleUser
middleware.use OmniAuth::Builder do
provider :facebook, ENV['FACEBOOK_KEY'], ENV['FACEBOOK_SECRET'], :scope => ENV['FACEBOOK_SCOPE']
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment