Facebook登录API出现问题

时间:2019-05-16 04:20:26

标签: javascript jquery facebook api facebook-login

因此,我尝试使用Facebook登录API,但不使用其SDK,但是即使我将所有可能的Urls列入了白名单,也会出现错误。

我遵循了有关如何手动设置它的指南,甚至遵循了讲师给我的个人指南,并且在网上搜索了此问题,却没有找到解决问题的方法

let my_URL = "https://webappdev-thorkazil99.c9users.io/Intelligent%20Media%20Systems/assignment3/webpack-demo/src/";

let my_FB_ID = "xxxxxxxxxxxxxxx";

let FBURL = "https://www.facebook.com/v3.3/dialog/oauth?client_id=" + my_FB_ID + "&redirect_uri=" + my_URL + "&response_type=token";

有效的OAuth重定向URI列表: https://webappdev-thorkazil99.c9users.io/Removehttps://webappdev-thorkazil99.c9users.io/Intelligent%20Media%20Systems/assignment3/webpack-demo/src/

https://webappdev-thorkazil99.c9users.io/Intelligent%20Media%20Systems/assignment3/webpack-demo/src/_oauth/facebook

https://webappdev-thorkazil99.c9users.io/Intelligent%20Media%20Systems/assignment3/webpack-demo/

https://webappdev-thorkazil99.c9users.io/Intelligent%20Media%20Systems/assignment3/webpack-demo/src/_oauth/facebook?close

  

警告URL被阻止:此重定向失败,因为重定向URI为   未在应用的“客户端OAuth设置”中列入白名单。确保客户   和Web OAuth登录已打开,并将您的所有应用程序域添加为有效OAuth   重定向URI。

1 个答案:

答案 0 :(得分:0)

我可能是错的,但是由于没有人试图回答您的问题,因此我会加以解决。

我认为该问题是网址编码/解码的结果。我认为您需要 url编码指定有效的OAuth重定向URI。因此,而不是

https://webappdev-thorkazil99.c9users.io/Intelligent%20Media%20Systems/assignment3/webpack-demo/src/

您将指定

https://webappdev-thorkazil99.c9users.io/Intelligent媒体系统/ assignment3 / webpack-demo / src /

注意:这仅适用于在有效OAuth重定向URI UI中指定url。您确实想用my_URL字符串对重定向URL进行url编码(已经完成)。

如果我是对的,则有效的OAuth重定向URI用户界面会使用您指定的字符串,并将其与重定向URL的URL解码版本进行比较。由于“ https://webappdev-thorkazil99.c9users.io/Intelligent Media Systems / assignment3 / webpack-demo / src /”(URL解码后的重定向URL)与“ https://webappdev-thorkazil99.c9users.io/Intelligent%20Media%20Systems/assignment3/webpack-demo/src/”(您列出为有效的重定向URL)不同,因此认为重定向网址无效。

相关问题