Google Cloud Endpoints:风景如画的应用

时间:2014-03-16 17:25:00

标签: python google-app-engine oauth-2.0 google-oauth

我目前正在学习Google App Engine。我想开发一个使用Google Cloud Endpoints提供同步的云应用。坦率地说,我对在Google I / O 2013中演示的图片应用程序(https://github.com/GoogleCloudPlatform/appengine-picturesque-python)印象深刻。此应用程序显示了我真正需要的功能。

要试用该应用程序,我从GitHub克隆它并通过Google App Engine Launcher运行它,然后当我测试它时,那里没有发生同步。所有图片都保存在本地。我已经使用我的客户端ID以及“custom-js / picturesque-config.js”创建并配置了“settings.py”文件,但是我在应用程序中看不到客户端 - 服务器交互。一切似乎在当地都有效。

我也遇到了谷歌身份验证的问题。在那里写了一个错误“Error:origin_mismatch”,其中包含所有请求详细信息。我一直试图解决这个问题一个星期,但仍然无法按预期工作。有人能解释一下这个问题吗?在此,我列出了有关请求详细信息的信息。

    from_login=1
    scope=https://www.googleapis.com/auth/userinfo.email 
    https://www.googleapis.com/auth/plus.login 
    https://www.googleapis.com/auth/plus.moments.write 
    https://www.googleapis.com/auth/plus.me 
    https://www.googleapis.com/auth/plus.profile.agerange.read 
    https://www.googleapis.com/auth/plus.profile.language.read 
    https://www.googleapis.com/auth/plus.circles.members.read
    redirect_uri=postmessage
    state=519184294|0.3676346342
    origin=http://localhost:22080
    as=-5faa3d6126cb2118
    display=page
    request_visible_actions=http://schemas.google.com/AddActivity
    hl=en-GB
    cookie_policy_enforce=false
    response_type=code token id_token gsession
    access_type=online
    cookie_policy=single_host_origin
    proxy=oauth2relay412480175
    include_granted_scopes=true
    client_id=604391723960.apps.googleusercontent.com
    authuser=0

非常感谢您的帮助。

谢谢

1 个答案:

答案 0 :(得分:2)

这是OAuth问题,如果您无法登录,则同步无法正常工作。

正如错误所说,你有一个" Origin Mismatch"。

什么是"重定向URI"在API控制台中为您的应用程序ID?您正在使用的URI - 例如http://localhost:8080 - 必须完全匹配,端口,HTTP方案和尾部斜杠。

您应该尝试通过检查StackOverflow上的现有答案来修复此错误:https://stackoverflow.com/search?q=error%3A+origin_mIsmatch

相关问题