facebook登录错误:URL已阻止:此重定向失败,因为重定向URI未列入白名单

时间:2016-12-21 11:41:54

标签: ruby-on-rails facebook facebook-graph-api omniauth

在我的rails app中,我使用Omniauth添加了facebook登录 我创建了我的应用程序,localhost上的一切都很好,但后来我在有效的OAuth重定向URI上添加了我的URL并开始收到此错误:

URL Blocked: This redirect failed because the redirect URI is not whitelisted in the app’s Client OAuth Settings. Make sure Client and Web OAuth Login are on and add all your app domains as Valid OAuth Redirect URIs.

我有效的outh重定向网址为:http://www.greyshift.co/profiles/new

我的域名是:www.greyshift.co 我的网站网址是:http://www.greyshift.co/

2 个答案:

答案 0 :(得分:0)

确保您已在https://developers.facebook.com定义了应用域,就像您在请求中一样

http://www.greyshift.co/

http://www.greyshift.co/http://www.greyshift.co

不同

在基本设置的“添加平台”选项中,选择网站并提供您的网站网址

答案 1 :(得分:0)

您需要查看您的Facebook登录按钮链接(您可能需要解码):

就我而言:https://web.facebook.com/dialog/oauth?response_type=code&redirect_uri=http://localhost:3000/api/auth/facebook/callback&scope=email&client_id=347056379050229&_rdc=1&_rdr

这是redirect_uri:http://localhost:3000/api/auth/facebook/callback

将其放入有效的OAuth重定向URI字段中 您可以从应用访问 - > Facebook登录 - >设置