ruby-on-railsdeviseomniauthfacebook-oauthcallbackurl

Rails OmniAuth Facebook 'Redirect URL must be absolute'


I am trying to set up omniauth to allow users to sign in to my website with facebook. I get the following error when i click on the log in button after following the Github Tutorial

enter image description here

In my devise.rb file i have:

  config.omniauth :facebook, "*****", "*****",
            callback_url: "CALLBACK_URL"

I am using ngrok so i am able to test with a url that isnt localhost. The url generated is http://46cbf60d.ngrok.io

In the facebook dashboard settings i have: enter image description here enter image description here

And in the facebook dashboard 'products/facebook login' i have enter image description here

Does anybody know how to fix this error?


Solution

  • In the devise.rb file, 'CALLBACK_URL' needs to be replaced with the callback url such as http://demo-app.herokuapp.com/users/auth/facebook/callback