首页 > 解决方案 > 我将 Google 授权重定向 URI 设置为我的实时/测试服务器上的 URI,但 Google 报告了 localhost 的重定向 URI

问题描述

我正在使用谷歌日历。我创建了 3 个项目:dev、test 和 live,并将重定向 URI 设置为https://liveURLhttps://testURLhttp://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 天时间阅读文档、答案和调试,老实说,我已经受够了。有什么想法吗?

标签: javaoauthgoogle-calendar-api

解决方案


推荐阅读