Created
March 23, 2012 12:38
-
-
Save timothyklim/2170325 to your computer and use it in GitHub Desktop.
omniauth.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
development: | |
google: | |
id: '34234sds343' | |
secret: 'drgfr' | |
facebook: | |
id: '3434' | |
secret: 'sds' | |
vkontakte: | |
id: '132' | |
secret: '1212' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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