我怎么会为同一用户的同一网站获得两个不同的开放 ID
我的印象是用户的开放 ID 保持不变。
我允许用户在我的应用程序中使用两个不同的屏幕在我的网站上设置开放ID...
我的印象是用户的开放ID是恒定的并且不会改变,我计划将其保存到我的数据库中 。
然而,令我惊讶的是,我在两个不同的屏幕中使用相同的 Google 帐户发现同一用户有不同的 id
open id 实际上是如何工作的?
更新:我发现谷歌这样做是基于开放ID领域。所以对于同一个领域,两个打开的 id 将是相同的(与 url 参数无关)
I was under the impression that the open id for a user remains constant.
I am allowing users to setup open id with my site with 2 different screens in my app...
I was under the impression that the open id for a user is constant and will not change and I was planning to save it to my database for a given user,
However, to my suprise, I found different ids for the same user using the same google account in the two different screens.
How does open id actually work ?
Update: I found that google does so based on open ID realm. so for the same realm, two open ids will be same (irrespective of the url parameters)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
那么您已经找到了问题的答案:Google 使用“定向身份”,这意味着 openid.realm 确定 openid.claimed_id 适用的范围。如果您希望两个“屏幕”获得相同的 OpenID,请确保领域相同,也许可以将其简化为
http://*.mydomain.com/
,包括通配符。You've already found the answer to your question then: Google uses "directed identity", meaning the openid.realm determines the scope that an openid.claimed_id applies to. If you want both "screens" to get the same OpenID, make sure the realm is the same, perhaps by simplying it down to
http://*.mydomain.com/
, including the wildcard character.