I believe the creating a customer provider is probably the proper way to do this, however I did not want to have to override every method in the provider to get the functionality I needed to use the email address as the username. I found no explainations on the net to date that would describe exactly which methods I would need to override to get the email to be used as the username. Here are the issues I ran into and my solution that looks like it will work.
The username cannot be changed easily, I originally thought I could just set the username equal to the email address. The problem I ran into is, the user might need to change his/her email address. If we did not change the username but only the email address, the user would see the original email address everytime the username property is referenced.
I thought I could then change the username by updating fields in the users table. This proved to be a problem because other entities like the personalization engine needed to put user entries in. I ran into syncronization issues where I made the change but the personalization engine was still using the previous username to store information.
So I decided the best course of action (that I could find anyway) was to generate a unique username and hide it from the user. Require email addresses to be unique and hide the username entry from the create user control. This fixed 90% of my problem. I simply checked for the User.Identity.Username for an email address and if I found one I would call the GetUserNameByEmail method to get the username for loading the MembershipUser object. However there was still one little minor problem "Password Recovery". I tried to extend the PasswordRecovery control but found that there were not enough events in the right places to handle the email/username swap.
In the end I wrote allot of username/email toggling code into the various event of the PasswordRecovery control to handle the last 10% I was missing from my solution. I use a session variable and the Page_Load, VerifyingUser, SendingMail, and PreRender events to accomplish the task.
This solution does not seem very elegant solution to me, but there is not very much information on the subject and I needed to get the job done.
If anyone has any better solution with a sample or solid explanation I would love to hear it. If anyone is interested in the code I would be happy to provide it.
Thanks,