我無法爲我的網站創建有效的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. OAuth API Google Drive Python
- 2. Google Drive OAuth在某些瀏覽器上觸發了origin_mismatch
- 3. Android Drive API OAuth BAD_AUTHENTICATION
- 4. Google API Oauth 2.0 cron工作?
- 5. Google+ OAuth API - 錯誤400
- 6. Google Drive API下載文件getIo錯誤
- 7. Android - Google Drive API實施中的錯誤
- 8. 訪問Google API時出現OAuth 2.0示例錯誤
- 9. Google Oauth 2.0範圍問題
- 10. Google Drive API IAuthenticator
- 11. Google Apps腳本 - Google Site中的origin_mismatch錯誤
- 12. OAuth訪問Google Drive授權問題
- 13. 谷歌聯繫人Api origin_mismatch
- 14. 爲Google Drive API設置OAuth 2.0同意屏幕 - 「沒有足夠的權限」
- 15. Google Drive API children.list
- 16. Google Drive API V3
- 17. Google Oauth錯誤:redirect_uri_mismatch
- 18. 帶有oauth 2.0的Google Reporting API
- 19. 在Android中使用Google API與OAuth 2.0
- 20. Google Api和android Oauth INVALID_AUDIENCE錯誤
- 21. Google Calendar API OAuth錯誤400 PHP
- 22. 代幣段數量錯誤(OAuth Google Api)
- 23. Google Apps腳本oAuth 2.0
- 24. Google Drive iOS的權限不足錯誤
- 25. Cakephp 2.0:Google Weather API錯誤+ Xml
- 26. Google oauth SSL證書錯誤
- 27. Google Drive API - 錯誤500 - 簡單的API訪問
- 28. Google Drive API - PHP(CRUD)
- 29. Google Drive API - MVC IDataStore
- 30. Google Drive Android API onChildrenRetrievedCallback
這不應該被關閉主題:「所需的行爲」:它不應該給他錯誤的起源不匹配。作者清楚地說明他做錯了什麼,並且他/她做了什麼來製作。 – 2016-01-31 15:58:23
同意,這真的很有幫助和可靠 – Fergus 2016-04-02 03:14:51