适用于云端硬盘API的Google API OAuth无法使用。获取错误:origin_mismatch [英] Google API OAuth for Drive API is not working. Getting Error: origin_mismatch

查看:174
本文介绍了适用于云端硬盘API的Google API OAuth无法使用。获取错误:origin_mismatch的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图运行Google Drive的实时API的快速启动代码。
我相信我做的都对。但我收到

$ p $ 错误:origin_mismatch

请求详细信息

openid_connect_request = true
cookie_policy_enforce = false
scope = https://www.googleapis.com/auth/drive.install https://www.googleapis.com/auth/drive.file https:// www .googleapis.com / auth / plus.me
response_type = token
access_type = online
redirect_uri = postmessage
proxy = oauth2relay601571239
origin = http://127.0。 0.1
state = 811328575 | 0.818765953
display = page
client_id = XXXXXXXXXX


解决方案

您没有给出有关您的应用程序体系结构的详细信息,因此我只能提供一个一般答案。 OAuth限制可以引用哪些网址。允许的网址列表可在API控制台中 https://code.google.com/apis/中配置控制台。网址非常繁琐,请确保您输入的地址与地址栏中显示的完全一样。



截至2013年10月,您无法使用localhost。您有2个选择。


  1. 将127.0.0.1 = mydevserver.example.com编辑到您的/ etc / hosts中

  2. 使用URL缩短器(例如goo.gl)为本地主机创建别名

然而,我相信它现在可以在
Google api控制台中配置localhost。


I am trying to run the quick start code of Real Time API of Google Drive. I believe I did everything right. But I am getting

Error: origin_mismatch

Request Details

    openid_connect_request=true
    cookie_policy_enforce=false
    scope=https://www.googleapis.com/auth/drive.install https://www.googleapis.com/auth/drive.file https://www.googleapis.com/auth/plus.me
    response_type=token
    access_type=online
    redirect_uri=postmessage
    proxy=oauth2relay601571239
    origin=http://127.0.0.1
    state=811328575|0.818765953
    display=page
    client_id=XXXXXXXXXX

解决方案

You haven't given much detail about your application architecture, so i can only suggest a general answer. OAuth restricts which URLs can be referred to it. The list of permitted URLs is configured in the API console at https://code.google.com/apis/console. The URL is very fussy, so make sure you enter it exactly as it appears in the address bar.

As at Oct 2013, you can't use localhost. You have 2 choices.

  1. edit 127.0.0.1 = mydevserver.example.com into your /etc/hosts
  2. use a url shortener (eg. goo.gl) to create an alias to localhost

However, I believe that it is now possible to configure localhost in the Google api console.

这篇关于适用于云端硬盘API的Google API OAuth无法使用。获取错误:origin_mismatch的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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