我无法为我的网站创建有效的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