首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >谷歌混合OpenID+OAuth登录不提示访问OAuth

谷歌混合OpenID+OAuth登录不提示访问OAuth
EN

Stack Overflow用户
提问于 2011-07-26 13:13:04
回答 1查看 754关注 0票数 2

我正在尝试在Google AppEngine站点上实现Google的混合OpenID+OAuth登录。由于某些原因,我的登录链接仅提示用户通过他们的谷歌帐户(OpenID)提供登录访问权限。它不要求访问联系人/文档/等(OAuth)。

Google站点上的示例使用以下URL进行登录:

代码语言:javascript
复制
https://accounts.google.com/o/openid2/auth?
openid.ns=http://specs.openid.net/auth/2.0&
openid.claimed_id=http://specs.openid.net/auth/2.0/identifier_select&
openid.identity=http://specs.openid.net/auth/2.0/identifier_select&
openid.return_to=http://googlecodesamples.com/hybrid/index.php&
openid.realm=http://googlecodesamples.com&
openid.mode=checkid_setup&
openid.ns.ui=http://specs.openid.net/extensions/ui/1.0&
openid.ns.ext1=http://openid.net/srv/ax/1.0&
openid.ext1.mode=fetch_request&
openid.ext1.type.email=http://axschema.org/contact/email&
openid.ext1.type.first=http://axschema.org/namePerson/first&
openid.ext1.type.last=http://axschema.org/namePerson/last&
openid.ext1.type.country=http://axschema.org/contact/country/home&
openid.ext1.type.lang=http://axschema.org/pref/language&
openid.ext1.required=email,first,last,country,lang&
openid.ns.oauth=http://specs.openid.net/extensions/oauth/1.0&
openid.oauth.consumer=googlecodesamples.com&
openid.oauth.scope=http://docs.google.com/feeds/+http://spreadsheets.google.com/feeds/+http://www-opensocial.googleusercontent.com/api/people/

Click here to visit link above

如果您单击该链接,请注意除了Docs和Contacts之外,它还会提示访问电子邮件/国家/语言。

如果我将这3个参数替换为我的值:

代码语言:javascript
复制
openid.return_to=http://2.myapp.appspot.com&
openid.realm=http://*.myapp.appspot.com&
openid.oauth.consumer=myapp.appspot.com&

它仍然显示登录页面,但只要求提供电子邮件/国家/语言...没有提到文档/联系人。

应用程序域名已经注册并通过Google验证--我是不是漏掉了什么?如果我单独实现OAuth,并为文档和联系人生成一个auth URL,它可以工作fine...but我真的很想用这种混合方法在一个步骤中完成所有事情,如果可能的话。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-07-26 13:55:42

对于被认为有效的混合请求,oauth2使用者和OpenID2领域必须“匹配”。在这种情况下,领域将匹配消费者的一些值,例如2.myapp.appspot.com,但不匹配myapp.appspot.com

一种可能的解决方案是也将'2.myapp.appspot.com‘注册为您的OAuth2消费者。

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/6825535

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档