From now on, let the website log on with an email address

Source: Internet
Author: User
Tags account security

 

Today, manyWeb2.0All websites useEmailAs the logon username, the address has the following advantages:

1.It is not easy to repeat. The user names are often repeated, causing users to have to use different user names between multiple websites, which is difficult to remember and manage.EmailThe address is unique.

2.Easy to remember. Frequently UsedEmailGenerally, there are no more than three addresses, so even if you forget which one is, you can try it out quickly.

3.Not easy to crack. The user name is usually visible to everyone on the website. This will lead some people with ulterior motives to pay attention to a specific user and defraud or brute force crack the account.EmailThe address is usually kept confidential on the website.EmailBefore the address is cracked, the account security is greatly improved.

 

Some websites use user names,EmailAddresses can all be logged on, which is more secure than the user name./Password Logon is easier, but more convenient for users. It is only applicable to websites that do not matter account security.

 

InASP. NETIn the Custom User Management SolutionEmailLogin is simple, and everything is under your control.

IntegrationMembershipAndASP. Network 2.0The implementation scheme of the logon control has not been found on the InternetArticleIt should be very simple:

1.Customize the logon control template and change the "user name" label to "email address ":

2.AddAuthenticateEvent proxy, in which custom verification is performed.E. authenticatedSetTrue:

However, it is okay to log on in this way, but it will be displayedEmailAddress, callPage. User. Identity. NameAttribute.EmailAddress, Which is awkward and inconvenient.

And even if it is reset in Event ProcessingLogin1.usernameIsEmailThe corresponding user name does not help.

 

After research, I found a more appropriate method, that is, throughFormsauthenticationClass self-implemented login:

Protected Void login1_authenticate (ObjectSender,AuthenticateeventargsE)

{

VaRName= Membership.Getusernamebyemail (login1.Username );

If(Membership.Validateuser (name, login1.Password ))Formsauthentication.Redirectfromloginpage (name, login1.Remembermeset );

}

In this way, the above problems can be solved perfectly and we recommend that you use them.

 

Download the PDF version of this article: http://www.box.net/shared/0bhfud0qjz

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.