我無法爲我的網站創建有效的Google Drive API。我聽起來像是一個完整的noob,但我在我的主ftp目錄中創建了一個名爲quickstart.html的文件,並複製並粘貼了代碼https://developers.google.com/drive/quickstart-js#step_1_enable_the_drive_api,並將客戶端ID替換爲我的客戶端ID,並在我的設置中設置了Javascript起源URL到我的主要網址(www.domainname.com),我有一個單獨的索引頁面,所以要訪問谷歌驅動器,我只是去http://domainname.com/quickstart.html?因爲當我這樣做,然後點擊「授權」,我得到谷歌產地不匹配錯誤。任何人都可以幫助我嗎?Google Drive API OAuth 2.0;錯誤:origin_mismatch
回答
確保您實際訪問www.domainname.com不只是domainname.com。有些瀏覽器會隱藏實際的網址,直到您將網址複製粘貼到其他程序中。確保你輸入整個URL,http和www。絕對肯定。
在Api Console中將您的重定向網址替換爲http並刪除https,您還可以使用'範圍':'https://www.googleapis.com/auth/plus.loginhttps://www.googleapis.com/auth/userinfo.email'。這個解決方案爲我工作。
這也適用於我。 – rjm226 2014-01-19 18:56:41
當然是.. – 2014-02-15 09:19:01
驗證「Web應用程序的客戶端ID」部分下的「JavaScript起源:」屬性和您在其上應用登錄代碼的頁面的URL必須相同。
'https:// www.'部分也必須匹配 – Dula 2016-07-17 19:40:26
- 1. 適用於Drive API的Google API OAuth不起作用。獲取錯誤:origin_mismatch
- 2. OAuth API Google Drive Python
- 3. Google Drive OAuth在某些瀏覽器上觸發了origin_mismatch
- 4. Google API OAuth 2.0
- 5. 防止oAuth 2.0 Google Drive憑據過期
- 6. Google Drive API 404 fileId錯誤
- 7. Google Drive api是否支持2腳oauth?
- 8. Google Drive實時API OAuth2刷新錯誤
- 9. 錯誤:使用Google日曆API和端口444時的origin_mismatch
- 10. Java Google表格API OAuth 2.0
- 11. Socialauth API 4.3與Google Oauth 2.0
- 12. Google API Oauth 2.0 cron工作?
- 13. Android Drive API OAuth BAD_AUTHENTICATION
- 14. Google+ OAuth API - 錯誤400
- 15. Google Drive API更改所有權oAuth
- 16. 錯誤:爲Google Analytics授權嵌入API時的origin_mismatch
- 17. Google Drive Api和Google Drive Web
- 18. 訪問Google API時出現OAuth 2.0示例錯誤
- 19. Google Oauth 2.0範圍問題
- 20. Google Drive API隨機401錯誤
- 21. Google Drive API下載文件getIo錯誤
- 22. Google Drive Api .Net上傳錯誤
- 23. cron作業中的Google Drive API錯誤
- 24. Android - Google Drive API實施中的錯誤
- 25. Magento的2.0 REST API OAuth錯誤
- 26. 錯誤YouTube中的OAuth 2.0 JAVA API
- 27. Google Drive API IAuthenticator
- 28. Google Drive API javascript
- 29. Google Apps腳本 - Google Site中的origin_mismatch錯誤
- 30. 谷歌聯繫人Api origin_mismatch
這不應該被關閉主題:「所需的行爲」:它不應該給他錯誤的起源不匹配。作者清楚地說明他做錯了什麼,並且他/她做了什麼來製作。 – 2016-01-31 15:58:23
同意,這真的很有幫助和可靠 – Fergus 2016-04-02 03:14:51