對於開源項目google-api-ruby-client,我試圖運行OAuth 2.0示例calendar.rb,該示例將訪問Google Calendar API。 我在Google API控制檯中創建了客戶端ID,並在ruby腳本中填寫客戶端ID和密碼。訪問Google API時出現OAuth 2.0示例錯誤
不過,我運行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
我檢查的谷歌API控制檯中的信息:
Redirect URIs: https://localhost/oauth2callback
JavaScript origins: https://localhost
有什麼問題,以及如何溶膠是嗎?提前致謝。
還提供了重定向的端口號和Javascript的URI – djd 2012-02-15 09:17:59