The problem is caused by the way OmniAuth renders provider names:
OmniAuth::Utils.camelize(:google_oauth2.to_s)
=> GoogleOAuth2
However, the provider is actually GoogleOAuth2
- fully qualified - OmniAuth::Strategies::GoogleOauth2
So, the solution is to use a fully qualified class: OmniAuth::Strategies::GoogleOauth2
Rails.application.config.middleware.use OmniAuth::Builder do provider OmniAuth::Strategies::GoogleOauth2, ENV["KEY"], ENV["SECRET"] end
source share