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