Omniauth Facebook authentication on localhost
22
15
|
I am trying to set up Omniauth as described in this Railscast. While it works with Twitter, I am unable to get it working with Facebook. I also set up 'http://localhost:3000' as siteurl and 'localhost' as domain but still see the following error message in the browser:
Does anyone of you have any suggestions on how to fix this? Thanks in advance.
| ||||||||||||
|
28
|
Take a look at the redirect in the URI. Mine read localhost:3000 so I changed the Site URL to "http://localhost:3000/" and it worked.
| ||||||||||||||||
|
26
|
Here's what worked for me.
Right now Facebook does not allow setting the Site Domain to an IP, so it's not possible to set the Site URL to
http://127.0.0.1:3000/ because then Facebook will complain that the URL does not match the domain.
So in your Facebook App set the:
When you access the app on your dev machine make sure you type in localhost:3000 in the browser. If you use 127.0.0.1:3000 OmniAuth will use that in the callback url it sends to Facebook and then Facebook will throw the error Ryan mentions above.
| ||||||||||||
|
14
|
I switch to http://lvh.me:3000 in my local browser to test facebook locally. Then in facebook app settings, make lvh.me your domain.
lvh.me is a registered domain pointing to 127.0.0.1 that a developer bought to test subdomains locally.
| ||||
7
|
Try using
for the 'Site URL'. This works for me. (Also, I don't have anything in the 'Site Domain' field.)
| ||||||||
|
0
|
If you are on OSX you can use pow http://pow.cx/ to rename localhost to
(is not really renamed, it's added)
you can set that as a valid domain name on facebook.
| ||||
|