Invalid redirect_uri with omniauth-facebook gem

So, I went into this guide , which explains how to start with omniauth. When I got to the end of 4 to test the application on localhost: 3000 / auth / facebook, I got this error:

{ "error": { "message": "Invalid redirect_uri: Given URL is not allowed by the application configuration.", "type": "OAuthException", "code": 191 } } 

I understand that the problem is with the URL in the Facebook Developer Center, but none of the solutions I read work for me ...

(I know there are some questions before this question, but I'm new to Ruby on Rails and need an explanation for mannequins.)

+7
source share
5 answers

Defining these settings in the Facebook Developer Center resolved this for me:

  • Application Domain: (empty)

  • Site URL: http://localhost:3000

+23
source

Check the website setting and set the website http://localhost:3000/ .

+2
source

If a Facebook user is generated in your Ruby on Rails application as

 http://localhost:3000/users/auth/facebook 

you need to configure the Facebook application (Website) in the "Application" section to redirect to

 http://localhost:3000/users/auth/facebook/callback 
+2
source

If you are in a production environment, then I just skipped www removal. from the URL of the website that you specify in the settings of the facebook application (settings> basic> Website using Facebook Login> website URL).

so instead of http://www.website.com/ you should enter http://website.com

this worked for me after a few hours trying to figure out what was wrong and why i was getting this erro redirect.

0
source

If you have already added the website URL, you must provide an email and enable your application live, you can add an email in the settings → base → contact email address, and then make your application in real time in APP REVIEW → MAKE "you_app_name" PUBLIC? → yes

0
source

All Articles