我应该使用 LightOpenID 将 REALM 设置为什么,以便 Google url 保持一致,以便存储在我的数据库中?
最近,我注意到,当将生成的身份存储在我的数据库中时,Google 有时会为同一用户返回不同的身份,从而导致单个用户有两个数据库条目。
经过一番研究,我发现 Google 使用 $openid->realm 以及用户名来创建身份。默认情况下,该领域将成为您网站的 URL。使用 LightOpenID,我应该将 $openid->realm 设置为多少,以使生成的 Google 身份保持一致,以便我可以将它们存储在我的数据库中?我可以将“领域”设置为我喜欢的任何内容吗?或者它必须与我的网址相关吗?
Recently, I noticed that when storing the resulting identity in my database, Google would sometimes return a different identity for the same user, resulting in two database entries for a single user.
After a little research, I figured out that Google uses $openid->realm along with the username to create the identity. And by default the realm becomes the URL of your website. Using LightOpenID, what should I set $openid->realm to for the resulting Google identities to remain consistent, so that I can store them in my database? Can I just set 'realm' to whatever I like? Or does it have to relate to my URL?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我查看了规范:
http://openid.net/specs/openid-authentication -2_0.html#realms
经过一番尝试和错误,我最终使用 http://*.mydomain.com 作为领域,我的问题得到了解决。谷歌总是返回相同的身份。最初我只是尝试 *.mydomain.com ,但这会产生错误。
I looked at the spec:
http://openid.net/specs/openid-authentication-2_0.html#realms
After some trial and error, I ended up using http://*.mydomain.com as the realm and my problem was solved. Google would always return the same identity. Originally I was trying simply *.mydomain.com and that was creating an error.