Reputation: 1276
i'm trying to authenticate with facebook i have a sinatra app working correctly with twitter.
app.rb
use OmniAuth::Builder do
provider :twitter, 'xxx', 'yyy'
provider :facebook, 'xxx', 'yyy', :redirect_uri => 'http://localhost:9393/auth/facebook'
end
i'm referencing the facebook link in my view like,
%a{:href=>"/auth/twitter"} Sign In To Twitter
%a{:href=>"/auth/facebook"} Sign In To Facebook
and i'm being returned
which looks like
{
"error": {
"message": "Invalid redirect_uri: Given URL is not allowed by the Application configuration.",
"type": "OAuthException",
"code": 191
}
}
as far as I can tell, my settings look correct. many posts exist about this issue being tied to facebook and the apps registered url.
on facebook, this app is registered as
Site URL
http://localhost:9393/
Site Domain
http://localhost:9393/
Thanks.
Upvotes: 0
Views: 221
Reputation: 1276
i actually found the answer,
App Domains: localhost/
and
Website with Facebook Login: http://localhost:9393/?
the /?
on the localhost (website w fb login) is the important detail
Upvotes: 1
Reputation: 705
I usually register a dev app in facebook and add the redirect_uri to my hosts file. Usually something like:
127.0.0.1 dev.mycoolapp.com
Upvotes: 0
Reputation: 9146
try App Domains: http://localhost/
its working for me in rails
Site URL: http://localhost:3000/
App Domains: http://localhost/
Upvotes: 0