How to create OmniAuth strategy aliases
# lib/omniauth-adwords-oauth2.rb | |
require "omniauth-google-oauth2" | |
class AdwordsOauth2 < OmniAuth::Strategies::GoogleOauth2 | |
option :name, 'adwords_oauth2' | |
end | |
# config/initializers/omniauth.rb | |
require "omniauth-adwords-oauth2" | |
Rails.application.config.middleware.use OmniAuth::Builder do | |
provider :adwords_oauth2, ENV['GOOGLE_API_CLIENT_ID'], ENV['GOOGLE_API_CLIENT_SECRET'], { | |
scope: "https://adwords.google.com/api/adwords/" # could also be adwords-sandbox.google.com | |
} | |
end | |
OmniAuth.config.logger = Rails.logger |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
You actually should be able to do this: