我怎么会为同一用户的同一网站获得两个不同的开放 ID

发布于 2024-08-27 22:22:03 字数 306 浏览 3 评论 0原文

我的印象是用户的开放 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

池予 2024-09-03 22:22:03

那么您已经找到了问题的答案: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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文