Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook app - login through omniauth - OAuthException 191

I am facing with the problem:

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

I set up in my app the needed keys and tokens, in the Facebook's dev center I set up Site URL: to http://127.0.0.1:3001 and I am getting the error above. Also I tried to set up App Namespace: to http://127.0.0.1:3001, but I am getting error about bad address format... When I tried to fill out he App Domain: and set there my localhost, again the error for the bad format...

What is the correct configuration the fabebook app with localhost?

like image 893
user984621 Avatar asked Mar 30 '12 10:03

user984621


3 Answers

You need to use urls, what I would do add this to your hosts:

127.0.0.1 dev-machine
127.0.0.1 dev-machine.com

Then in the facebook settings use

dev-machine.com as your App Domain

dev-machine.com:3001 as your Site URL

like image 124
Abe Petrillo Avatar answered Nov 13 '22 16:11

Abe Petrillo


Yes in FB App you have to assign an IP Site/ App Domain.

  • Facebook matches this url with the url of the request where it came from.
  • You can not assign localhost or 127.0.0.1
  • You have to enter the IP address your server. Also if it is rails then call the site with your-ip:3000 instead of localhost:3000; I use 192.168.1.154:3000
  • Enter the same IP address in IP of the site and APP Domain in your FB APP Settings.
  • To get your IP run ifconfig command in terminal if it is Linux or ipconfig if windows.

let me know if it doesn't work.

like image 7
Kashyap Avatar answered Nov 13 '22 16:11

Kashyap


in the facebook App Page -> the basic tab. find "Website with Facebook Login" Option.

you will find Site URL: input there put the full URL (i.e http:// localhost:3000 if you are in Development mode) [* note : not "App Domains"]

like image 1
aniruddha Birajdar Avatar answered Nov 13 '22 16:11

aniruddha Birajdar