The parameter app_id is required on Heroku omiAuth facebook Integration

纵然是瞬间 提交于 2019-12-02 14:59:11

问题


I am getting the error "The parameter app_id is required" when I test my facebook login in my app. I guess it has to do with my configurations. Can you please check my configuration files and let me know if there is an error. I even set the app id and secret on heroku

heroku config:set FACEBOOK_APP_ID=133333333463066  
              FACEBOOK_SECRET=a7244e333333333a7a2bf9492a6089a0

Here is my omniauth initializer file : config/initializer/omniauth.rb

OmniAuth.config.logger = Rails.logger
Rails.application.config.middleware.use OmniAuth::Builder do
provider :facebook, ENV["FACEBOOK_APP_ID"], ENV["FACEBOOK_SECRET"]
end

My devise initializer has the following line:

config.omniauth :facebook, "FACEBOOK_APP_ID" , "FACEBOOK_SECRET"

What am I doing wrong ?

On localhost, I am getting this error instead:

{
 "error": {
  "message": "Missing client_id parameter.",
  "type": "OAuthException",
  "code": 101
 }

}

I get this url when I try to login with facebook

https://graph.facebook.com/oauth/authorize?  client_id=&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Fusers%2Fauth%2Ffacebook%2Fcallback&response_type=code&scope=email&state=223cbab26ab10640a2c1fe62508aecb94ffc2854721703de

As you can see, client id is empty in the URL.

来源:https://stackoverflow.com/questions/30250939/the-parameter-app-id-is-required-on-heroku-omiauth-facebook-integration

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!