gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-28 23:05:00 24 4
gpt4 key购买 nike

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

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

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

如果您单击该链接,请注意它如何提示访问电子邮件/国家/语言以及文档和联系人。

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

openid.return_to=http://2.myapp.appspot.com&
openid.realm=http://*.myapp.appspot.com&
openid.oauth.consumer=myapp.appspot.com&

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

应用域已通过 Google 注册和验证 - 我是否遗漏了什么?如果我单独实现 OAuth 并为 Docs & Contacts 生成一个 auth URL,它工作正常......但如果可能的话,我真的很想用这种混合方法一步完成所有事情。

最佳答案

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

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

关于python - 谷歌混合 OpenID+OAuth 登录不提示 OAuth 访问,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6825535/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com