简体   繁体   English

本地主机上的Google Plus登录Cookie政策

[英]Google Plus Sign In Cookie Policy on localhost

I'm putting together a webapp that uses google plus signin using this guide . 我正在使用本指南整理一个使用google plus signin的webapp。

I am running the webapp on localhost:8888 . 我在localhost:8888上运行webapp。

Using javascript like this, things work fine: 使用像这样的JavaScript,一切正常:

    gapi.signin.render(thisHandle.details.buttonId, {
        'callback': mySignIn,
        'clientid': myClientId,
        'requestvisibleactions': 'http://schemas.google.com/AddActivity',
        'scope': 'https://www.googleapis.com/auth/plus.login',
        'theme': 'light',
        'cookiepolicy': 'single_host_origin',
        'accesstype': 'offline'
    });

If I change my cookiepolicy to 'http:// localhost:8888' I get: 如果我将我的cookiepolicy更改为'http:// localhost:8888',我会得到:

Error: invalid_request Authority not strictly under a public suffix: localhost :8888 错误:invalid_request权限不严格在公共后缀下: localhost :8888

Request Details 索取详细资料

response_type=code token id_token gsession scope= https://www.googleapis.com/auth/plus.login redirect_uri=postmessage access_type=offline cookie_policy=http:// localhost :8888 proxy=oauth2relay874392806 origin=http:// localhost :8888 state=384885884|0.12629541 client_id=[My client id] request_visible_actions= http://schemas.google.com/AddActivity authuser=0 response_type =代码令牌id_token gsession作用域= https://www.googleapis.com/auth/plus.login redirect_uri = postmessage access_type = offline cookie_policy = http:// localhost :8888 proxy = oauth2relay874392806 origin = http:// localhost :8888 state = 384885884 | 0.12629541 client_id = [我的客户ID] request_visible_actions = http://schemas.google.com/AddActivity authuser = 0

What does Authority not strictly under a public suffix means in this context, in terms of storing user and session information? 在存储用户和会话信息方面,在这种情况下, 权限不严格属于公共后缀的含义是什么? Is there a workaround that would allow me to have is running my development server? 是否有一种解决方法可以让我运行我的开发服务器? Any help much appreciated. 任何帮助非常感谢。

For your development work, you can stick with single_host_origin or use none (less efficient). 为了您的开发工作,你可以坚持single_host_origin或使用none (低效率)。 The cookie policy is more important when your signed in user might be visiting your site on multiple protocols (http & https) or with subdomains (www.example.com and support.example.com). 当您的登录用户可能通过多种协议(http&https)或带有子域(www.example.com和support.example.com)访问您的网站时,cookie策略更为重要。 In those cases, you'd likely want to use the cookiepolicy of http://example.com 在这种情况下,您可能希望使用http://example.com的cookiepolicy

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM