Ker*_*ght 8 python openid oauth hybridauthprovider
我正在尝试将Google联合登录与首要应用帐户集成,但我遇到了一些问题.
当我将请求发送到:https://www.google.com/accounts/o8/ud带有所有参数(见下文)时,我会返回a request_token和要求的属性列表Attribute Exchange.这是完美的,因为我们需要通过属性传递(AX)的电子邮件将用户存储在我们的应用程序数据库中,并且我们需要未来的请求令牌API requests to scopes(即:日历,联系人等).
但是,使用该URL(此处称为endpoint)不会使用户登录其托管应用程序(gmail,日历等),这是一个问题.
更改端点以https://www.google.com/a/thedomain.com/o8/ud?be=o8更改所有内容.我自动登录到其他谷歌应用程序(Gmail等).但是,使用该端点,我只通过AX 获取请求令牌或属性.显然那不是特别混合.非常一个或那个.
对端点的示例请求 https://www.google.com/accounts/o8/ud
parameters = {
'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://our.domain.com/accounts/callback/',
'openid.realm': 'http://our.domain.com/',
'openid.assoc_handle': assoc_handle,
'openid.mode': 'checkid_setup',
'openid.ns.ext2': 'http://specs.openid.net/extensions/oauth/1.0',
'openid.ext2.consumer': 'our.domain.com',
'openid.ext2.scope': 'https://mail.google.com/mail/feed/atom',
'openid.ns.ax':'http://openid.net/srv/ax/1.0',
'openid.ax.mode':'fetch_request',
'openid.ax.required':'firstname,lastname,email',
'openid.ax.type.firstname':'http://axschema.org/namePerson/first',
'openid.ax.type.lastname':'http://axschema.org/namePerson/last',
'openid.ax.type.email':'http://axschema.org/contact/email',
}
return HttpResponseRedirect(end_point + '?' + urllib.urlencode(parameters))
Run Code Online (Sandbox Code Playgroud)
(assoc_handle先前由openid初始请求成功设置)
我一直在努力让这种Hybird方法正常工作,对抗最不透明的错误信息(This page is invalid...感谢Google)以及缺乏一致的文档.我已经拖曳了每个代码示例,我可以到达这一点.任何帮助,将不胜感激 ...
对于记录,后代以及任何可能对此有所了解的人,我将记录(荒谬的)答案.
最终,问题在于:
return HttpResponseRedirect(
'https://www.google.com/a/thedomain.com/o8/ud?be=o8'
+ '?'
+ urllib.urlencode(parameters)
)
Run Code Online (Sandbox Code Playgroud)
你能发现它吗?是的,明确包含导致问题的问号.两个查询字符串不会同时存在.
| 归档时间: |
|
| 查看次数: |
2147 次 |
| 最近记录: |