我正在尝试实施 Google 的OpenID+OAuth https://developers.google.com/accounts/docs/OpenID#oauth协议,当 openid.realm 包含通配符时它不起作用:
openid.realm: http://*.example.com
openid.ns.oauth = http://specs.openid.net/extensions/oauth/1.0
openid.oauth.consumer = www.example.com
openid.oauth.scope = https://www.googleapis.com/auth/userinfo.profile
OpenID 进程按预期工作,但 OAuth 扩展被静默忽略(响应中没有 request_token;也没有错误)。
根据文档 https://developers.google.com/accounts/docs/OpenID#oauth这似乎得到支持:
使用自动化界面注册您的域名,请记住
注册的域名必须与realm参数一致
与 OpenID 一起使用。例如,域名“www.somedomain.com”
与“http://*.somedomain.com”领域一致。
它适用于以下领域http://www.example.com
(回调接收 request_token 参数),但是我无法更改领域,因为这会阻止现有用户再次登录。
我究竟做错了什么 ?
The consumer
必须是实际域名,而不是通配符。还,*.example.com
指定子域example.com
; example.com
is not是一致的http://*.example.com
Goggle 文档不清楚,但您可能需要向 Google 注册您的网站 https://developers.google.com/accounts/docs/RegistrationForWebAppsAuto为了将 OpenID+OAuth 与通配符域一起使用。如你看到的,JohnS https://stackoverflow.com/users/483728/johns能够得到带有通配符域的 OpenID+OAuth https://stackoverflow.com/a/4319375/712765与您的设置没有任何记录的差异(除了使用ex2
代替ouath
作为名称空间别名,但这并不重要)。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)