zquestz/omniauth-google-oauth2 — Issue #19: Not working on Heroku apps
Author: dabit
Created: 2012-02-19 16:39:05+00:00
State: open

I am trying to use Google Apps authentication for an app that will be hosted on Heroku.com

Everything works great locally, but once I try on Heroku it doesn't works. Google will always return to the auth failure url.

According to Devise Wiki:

If your app is running on Heroku (and you have been pulling your hair out for hours), the config section needs to look like this:

config.omniauth :facebook, "APP_ID", "APP_SECRET",
{:scope => 'email, offline_access', :client_options => {:ssl => {:ca_file => '/usr/lib/ssl/certs/ca-certificates.crt'}}}

On Engine Yard Cloud servers, the CA file is located at /etc/ssl/certs/ca-certificates.crt.

How can I make my middleware config use the ssl option?

Rails.application.config.middleware.use OmniAuth::Builder do
provider :google_oauth2, ENV['GOOGLE_APP_ID'], ENV['GOOGLE_SECRET_KEY']
end