使用 LightOpenID 的用户管理策略

发布于 2024-10-25 12:52:36 字数 167 浏览 5 评论 0原文

我最近发现了 LightOpenID,我将使用它作为我下一个网站的登录系统。

当我在用户使用 LighOpenID 注册/登录时获取一些信息时,我想知道在我的 USERS 表中使用用户的电子邮件作为唯一 ID 在技术上是否可以,或者这是否是一个坏主意?

谢谢各位,

FX

I've discovered recently LightOpenID wich i'm going to use as a login system for all my next websites.

As i'm fetching some infos when users register/login with LighOpenID, I'd like to know if it's technically ok to use user's email as unique id in my USERS table or if it's a bad idea ?

Thanks guys ,

FX

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

我ぃ本無心為│何有愛 2024-11-01 12:52:36

考虑考虑:

  1. 电子邮件帐户与您的 OpenID 帐户关联并不是强制性的。
  2. 如果存在电子邮件地址,即使您询问,也不能保证您能从服务器取回它。
  3. 即使您获得了地址,您仍然需要验证它(例如,通过发送带有随机令牌的电子邮件)。
  4. 用户可能会拥有多个 OpenID 标识符(只要您在 Google 或 Yahoo 等一些主要服务上开设帐户,您就会遇到这种情况)。其中一些将共享相同的电子邮件地址,一些则不会,有些甚至没有设置电子邮件地址。
  5. 当用户在幕后更改其电子邮件地址时,他将失去您网站上的帐户。
  6. 使用电子邮件作为密钥并没有真正提供我能想到的任何优势。

我的建议是,如果你想使用 OpenID,你应该正确使用。成功验证后,从 $openid->identity() 读取 OpenID URL,并使用它来识别用户。

另外:

  • 请记住,URL 可能很长;不要尝试将其填充到 VARCHAR(100) 列中。
  • 您可能希望像 Stack Overflow 那样实现链接身份。

Thinks to consider:

  1. It isn't mandatory to have an e-mail account linked to your OpenID account.
  2. If there is an e-mail address, you are not guaranteed to get it back from the server, even if you ask.
  3. Even if you get the address, you'd still need to validate it (e.g., by sending an e-mail message with a random token).
  4. Users will probably own more than one OpenID identifiers (you are in such situation as soon as you open accounts at some major services like Google or Yahoo). Some of them will share the same e-mail address, some will not, and some will not even have an e-mail address set.
  5. When the user changes his e-mail address behind the scenes, he'll lose his account at your site.
  6. Using the e-mail as key does not really offer any advantage I can think of.

My advice is that, if you want to use OpenID, you should do it right. Read the OpenID URL from $openid->identity() after successful validation and use that to identify the user.

Additionally:

  • Keep in mind that URLs can be long; don't try to stuff it into a VARCHAR(100) column.
  • You might want to implement linked identities as Stack Overflow does.
贱人配狗天长地久 2024-11-01 12:52:36

这取决于你的服务。通常,每个电子邮件地址仅分配给一个人。如果不需要每个用户有多个帐户,也可以。
有些家庭有家庭电子邮件地址。但我猜他们也会使用同一个帐户。

为什么不采用OpenID作为唯一ID呢? OpenID 是唯一的,如果您仅使用 OpenID 登录,那么您会在获取电子邮件地址之前获取 OpenID。

It depends on your service. Normally, every email-adress is only assigned to one person. If multiple accounts per user are not wanted, it's ok.
Some families have a family-email-adress. But I guess they would also use the same account.

Why don't you take the OpenID as the unique ID? OpenIDs are unique and you get the OpenID before you get the Email-Adress, if you use only OpenID for logging in.

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