java - 我将 Google 授权重定向 URI 设置为我的实时/测试服务器上的 URI,但 Google 报告了 localhost 的重定向 URI
问题描述
我正在使用谷歌日历。我创建了 3 个项目:dev、test 和 live,并将重定向 URI 设置为https://liveURL、https://testURL和http://localhost。
使用 Google 日历 API 添加事件在 localhost 中有效,但我收到重定向 URI 不匹配错误 - Google 使用http://localhost:43832/Callback将代码和范围附加到 URI(端口号每次都会更改)。
我知道我正在设置重定向 URI,因为这是我通过的 clientsSecrets 的一部分(在测试中):
“redirect_uris”:[“ https://golioio.herokuapp.com/tasks/addToGoogleCalendar ”,“ https://golioio.herokuapp.com/tasks/addToGoogleCalendar/ ”,“ https://golioio.herokuapp.com ”, " https://golioio.herokuapp.com/ "," https://golioio.herokuapp.com/Callback " ]
我也包括了应用程序根目录。
我花了 7 天时间阅读文档、答案和调试,老实说,我已经受够了。有什么想法吗?
解决方案
推荐阅读
- java - Spring boot Oauth2 JWT 范围不足错误
- java - 我可以同时创建 SQLite 表和插入值吗?
- arrays - Google Sheet 如何提取与另一列匹配的列?
- node.js - 如何获得以米为单位的距离?
- vba - 在 ms 访问表单中快速输入日期
- android - Restmock 服务器总是返回 500
- python - 从多列替换“.0”
- jquery - highcharts 中的错误 17:Highcharts-more js 文件未加载
- php - DIvi Theme Builder 出现未知错误,请稍后再试
- css - 在 Firefox 59.0 中隐藏滚动条