javascript - Facebook 登录 : Please make sure your redirect_uri is identical to the one you used in the OAuth dialog

标签 javascript php html facebook

所以我没主意了,我不知道要检查或调试什么了,但是在异常情况下我得到了这个:

string(188203) "Facebook\FacebookAuthorizationException Object
(
    [statusCode:Facebook\FacebookRequestException:private] => 400
    [rawResponse:Facebook\FacebookRequestException:private] => {"error":{"message":"Error validating verification code. Please make sure your redirect_uri is identical to the one you used in the OAuth dialog request","type":"OAuthException","code":100,"fbtrace_id":"DqCCKoiN0r4"}}
    [responseData:Facebook\FacebookRequestException:private] => Array
        (
            [error] => Array
                (
                    [message] => Error validating verification code. Please make sure your redirect_uri is identical to the one you used in the OAuth dialog request
                    [type] => OAuthException
                    [code] => 100
                    [fbtrace_id] => DqCCKoiN0r4
                )

        )

    [message:protected] => Error validating verification code. Please make sure your redirect_uri is identical to the one you used in the OAuth dialog request
    [string:Exception:private] => 
    [code:protected] => 100

最佳答案

您可以在中设置重定向 URI 转到 https://developers.facebook.com/apps 选择您的应用。

在“产品”>“Facebook 登录”>“设置”下

  • 启用嵌入式浏览器 OAuth 登录
  • 设置有效的 OAuth 重定向 URI

您可以使用重定向 URI 验证程序验证重定向 URI。

您只能使用 https URI。 同时在设置 > 基本 > 应用域中设置应用域

在重定向 URI 的末尾尝试 /

在我的例子中,我到处都在使用 https://localhost,但在获取指定 https://localhost/ 的访问 token 时不知何故有效。

关于javascript - Facebook 登录 : Please make sure your redirect_uri is identical to the one you used in the OAuth dialog,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38477149/

相关文章:

javascript - 更改弹出消息

javascript - 使用 php 和 javascript 创建实时聊天

php - 图像在 IE 中未正确对齐

php - 标题对齐问题

javascript - 有人可以解释为什么我的 javascript 不工作吗?

javascript - Selection.addRange() 已弃用,将从 Chrome 中删除

具有只读属性的 Javascript 对象

javascript - 为什么在使用完整渲染或浅渲染时,带有组件 Prop 的 enzyme find() 的工作方式不同?

php - 获取数据以便在表单上进行编辑

javascript - 可以使用 "alias"或 "macro"来调用 HTML 中的 JavaScript 函数吗?