gpt4 book ai didi

java - Spring Boot Social 无法通过 localhost 连接到 facebook

转载 作者:行者123 更新时间:2023-11-30 03:13:43 26 4
gpt4 key购买 nike

我正在尝试使用 spring-boot-starter-social-facebook 连接到 facebook 并打印我的个人资料名称,但我不明白为什么失败。

FacebookController.java

enter image description here

/connect/facebookConnect.html

enter image description here

然后在developer.facebook.com上,我像这样配置了我的应用程序。 .

enter image description here

enter image description here

我还在 applicationProperties 中设置了 appid 和 appsecret。然后当我尝试运行并按“连接”时,浏览器加载约 10 秒,然后在 Spring Tool Suite 的控制台中它打印 . 。 .

处理 OAuth2 回调时出现异常(“https://graph.facebook.com/v2.3/oauth/access_token ”的 POST 请求上出现 I/O 错误:连接超时:连接;嵌套异常为 java.net.ConnectException:连接超时:连接)。重定向至 Facebook 连接状态页面。

我将链接粘贴到浏览器中,它显示

{
"error": {
"message": "Missing redirect_uri parameter.",
"type": "OAuthException",
"code": 191,
"fbtrace_id": "ClbUIsKtnXt"
}
}

我想我搞砸了在 facebook 中配置 testapp。

站点URL = http://localhost:8080/

有效的 Oauth 重定向 = http://localhost:8080/connect/facebook

我该怎么办?预先感谢您。

最佳答案

尝试将本地主机添加到应用程序域 - 我的设置:

enter image description here

关于java - Spring Boot Social 无法通过 localhost 连接到 facebook,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33122074/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com