【发布时间】:2012-03-06 14:32:16
【问题描述】:
使用开源项目google-api-ruby-client,我正在尝试运行 OAuth 2.0 示例 calendar.rb,它将访问 Google 日历 API。 我在 Google API 控制台中创建了客户端 ID,并在 ruby 脚本中填写了客户端 ID 和密钥。
但是,在我运行 ruby 脚本之后
ruby calendar.rb
然后打开http://localhost:4567,浏览器从谷歌返回错误信息给我:
Error: redirect_uri_mismatch
The redirect URI in the request: http://localhost:4567/oauth2callback did not match a registered redirect URI
我在 Google API 控制台中查看了信息:
Redirect URIs: https://localhost/oauth2callback
JavaScript origins: https://localhost
有什么问题以及如何解决?提前致谢。
【问题讨论】:
-
还要在重定向和Javascript URI中提供端口号
标签: ruby oauth google-api oauth-2.0 google-api-client