Google Drive API OAuth 2.0;错误:origin_mismatch [英] Google Drive API OAuth 2.0; Error: origin_mismatch

查看:115
本文介绍了Google Drive API OAuth 2.0;错误:origin_mismatch的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法为我的网站创建有效的Google Drive API。我听起来像是一个完整的noob,但我在我的主ftp目录中创建了一个名为quickstart.html的文件,并将代码从 https://developers.google.com/drive/quickstart-js#step_1_enable_the_drive_api ,并用我的客户端ID替换客户端ID,在我的设置中,我将JavaScript起源URL设置为我的主要URL(www .domainname.com),我有一个单独的索引页面,因此要访问谷歌驱动器,我只需去 http:// domainname。 COM / quickstart.html ?因为当我这样做,然后点击授权,我得到谷歌产地不匹配错误。任何人都可以帮助我吗?

I'm having trouble creating a valid google drive API for my website. I may sound like a complete noob, but I created a file called quickstart.html in my main ftp directory and copied and pasted the code from https://developers.google.com/drive/quickstart-js#step_1_enable_the_drive_api and replaced the client id with my client id, and in my settings I set the Javascript Origins URL to my main url (www.domainname.com), I have a separate index page for that domain, so to access google drive do I just go to http://domainname.com/quickstart.html? Because when I do that and click "Authorize" I get the google Origin Mismatch error. Can anyone help me please?

推荐答案

在Api控制台中,将您的重定向网址替换为http并删除https, ':' https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/userinfo.email '。这个解决方案适用于我。

in Api Console replace your redirect urls to http and remove https and You can also use 'scope': 'https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/userinfo.email' . This solution worked for me.

这篇关于Google Drive API OAuth 2.0;错误:origin_mismatch的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆