You can use email as the username so you cut down the number of fields in your database. The problem with this is that if a user wants to have different accounts with the same email, he wouldn't be able to do it. If you don't care about this, you can easily use the email.
The most user-friendly solution is to use the minimal (yet still secure enough) number of data to sign in into the service.
So, basically, using email address to sign in is the better idea.
This has not much limitations when signing up multiple times (you can use one account to sign in multiple times eg. by adding +something to the email address, eg. in GMail, creating eg. [email protected]).
This is also not giving you much additional help with limiting data within database, because you should not display the email address as the username (thus you should not get rid of username field in the database if you still need to identify the user to different users).
Probably only reason to do that is to increase user-friendliness.
Even better than email, when signing in:
There is still something even better than limiting (from username+password to only password) the amount of data user has to rememeber. You can allow this person to use some account that he/she already posseses and uses eg. every day, but you can make it secure. Most popular solutions here are OAuth (see more) and OpenID (see more).
发布评论
评论(3)
您可以使用电子邮件作为用户名,这样可以减少数据库中的字段数量。这样做的问题是,如果用户想要使用同一电子邮件拥有不同的帐户,他将无法做到这一点。如果您不关心这个,您可以轻松使用电子邮件。
You can use email as the username so you cut down the number of fields in your database. The problem with this is that if a user wants to have different accounts with the same email, he wouldn't be able to do it. If you don't care about this, you can easily use the email.
最用户友好的解决方案是使用最少(但仍然足够安全)的数据来登录服务。
因此,基本上,使用电子邮件地址登录是更好的主意。
这在多次注册时没有太大限制(您可以使用一个帐户多次登录,例如,通过将
+something
添加到电子邮件地址,例如在 GMail 中,创建例如[电子邮件受保护]
)。这也没有给您在限制数据库中的数据方面提供太多额外的帮助,因为您不应该将电子邮件地址显示为用户名(因此,如果您仍然需要,您不应该删除数据库中的
username
字段)以将用户识别为不同的用户)。这样做的唯一原因可能是为了提高用户友好性。
登录时比电子邮件更好:
还有比限制(从用户名+密码到仅密码)用户必须记住的数据量更好的方法。您可以允许此人使用他/她已经拥有和使用的某些帐户,例如。每天,但您可以确保其安全。这里最受欢迎的解决方案是OAuth(查看更多)和OpenID (查看更多)。
The most user-friendly solution is to use the minimal (yet still secure enough) number of data to sign in into the service.
So, basically, using email address to sign in is the better idea.
This has not much limitations when signing up multiple times (you can use one account to sign in multiple times eg. by adding
+something
to the email address, eg. in GMail, creating eg.[email protected]
).This is also not giving you much additional help with limiting data within database, because you should not display the email address as the username (thus you should not get rid of
username
field in the database if you still need to identify the user to different users).Probably only reason to do that is to increase user-friendliness.
Even better than email, when signing in:
There is still something even better than limiting (from username+password to only password) the amount of data user has to rememeber. You can allow this person to use some account that he/she already posseses and uses eg. every day, but you can make it secure. Most popular solutions here are OAuth (see more) and OpenID (see more).
如果您正在谈论登录表单,那么最好让用户通过接受两者来选择。
例如:
注册时,用户应该指定一个唯一的用户名,无论他们是否使用它。
If you are talking about a login form, it would be nice to let the user choose by accepting both.
Like:
When registering, the user should specify a unique username, whether they be using it or not.