Skip to content

Instantly share code, notes, and snippets.

@timothyklim
Created March 23, 2012 12:38
Show Gist options
  • Save timothyklim/2170325 to your computer and use it in GitHub Desktop.
Save timothyklim/2170325 to your computer and use it in GitHub Desktop.
omniauth.rb
development:
google:
id: '34234sds343'
secret: 'drgfr'
facebook:
id: '3434'
secret: 'sds'
vkontakte:
id: '132'
secret: '1212'
oauth_config = YAML::load_file("#{Rails.root}/config/oauth_credentials.yml")[Rails.env] rescue fail("#{Rails.root}/config/oauth_credentials.yml for #{Rails.env} not exists!")
Rails.application.config.middleware.use OmniAuth::Builder do
oauth_config.each do |provider, params|
provider provider, params['id'], params['secret']
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment