【问题标题】:Uncaught error...FB.Auth.setAuthResponse only compatible with OAuth2未捕获的错误...FB.Auth.setAuthResponse 仅与 OAuth2 兼容
【发布时间】:2011-12-09 14:23:18
【问题描述】:

在为 facebook 使用新的 Javascrip SDK 时,我在尝试时遇到以下错误

(function() {
var e = document.createElement('script'); e.async = true;
e.src = document.location.protocol +
  '//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);}());
window.fbAsyncInit = function(e) {
var curLoc = window.location;
var channel = curLoc.protocol + "//" + curLoc.hostname + (curLoc.pathname).substr(0,(curLoc.pathname).lastIndexOf('/')) + "/channel.html";
FB.init({ appId: APP_ID, 
    status: true, 
    cookie: true,
    xfbml: true,
    channelUrl: channel,
    oauth: true});
FB.getLoginStatus(isUserLoggedIn);
FB.Canvas.setAutoGrow();}

未捕获的错误:FB.Auth.setAuthResponse 仅与 OAuth2 兼容

这是什么原因?我的应用程序处于 SSL 模式,我似乎无法弄清楚为什么会出现该错误。

【问题讨论】:

    标签: facebook login oauth-2.0


    【解决方案1】:

    这绝对是唯一包含 JS SDK 的地方吗?检查复制/粘贴的 Like 按钮初始化代码等。

    当人们在 URL 中包含带有某些参数的 JS SDK(即在某处包含 //connect.facebook.net/en_US/all.js#appid=x)时,我已经看到这个错误发生 - 这会覆盖一些FB.init 调用中的参数,并可能导致您收到错误消息

    【讨论】:

      【解决方案2】:

      在我的情况下,我必须将 oauth2 设置为 true。错误来自另一个使用 oauth2 的 facebook 插件(我们都应该这样做,所有 fb 文档都应该反映这一点,天哪)并与 oauth1 fb 会话冲突。

      【讨论】:

        猜你喜欢
        • 2011-11-24
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-02-27
        • 1970-01-01
        • 2012-07-09
        • 1970-01-01
        相关资源
        最近更新 更多