Shoaib Ali
Shoaib Ali

Reputation: 11

Facebook OmniAuth throwing parameter app_id required when deployed on Heroku

So, I've been developing my app locally for sometime now and I decided today that I would like to deploy it on Heroku to start getting initial feedback for the app. I went through the guide on Heroku to help deploy my Rails 5 app to heroku.

Deployment was smooth and I was shown my login page. I clicked on Login Via FB and I was returned a white page with the following error response

The parameter app_id is required

Now, my obvious plan of action was to follow the trail, refer SO and hopefully come up with a solution for this. I tried every plausible resource on the web but I still get this error.

I've even updated my APP_ID and APP_SECRET variables on heroku. I've even updated Valid OAuth Redirect URIs section in my fb developer settings with the appropriate Heroku URL.

The funny bit is that everything works smoothly on my localhost but fails on heroku which is strange.

I strongly believe that Facebook would through appropriate errors and that app_id is in fact not being sent to fb. If this is the case, how do I solve this?

If you need code snippets to look at, do ask what might be needed to be looked at and I shall update my post accordingly.

Thank you!

Upvotes: 0

Views: 185

Answers (1)

Shoaib Ali
Shoaib Ali

Reputation: 11

the solution turned out to be a pretty simple one. In my application.yml file I had saved my Facebook vars as facebook_app_id and facebook_secret_key. But in my Heroku config vars I had included them as FACEBOOK_APP_ID and FACEBOOK_SECRET_KEY. I was under the impression keys aren't case sensitive. When I changed them to lowercase for Heroku, it worked.

Upvotes: 1

Related Questions