1

This link here lists model class and view class properties to change in order to prompt the user for email and password log in, rather than the default username and password required by Asp.NET Identity Authentication. However, it does not demonstrate how to remove the requirement of creating a username upon registration for the user in Identity.

Can someone point me to a resource that would allow me to completely remove the username requirement from Identity Authentication? I don't want my users to have to complete this extraneous step.

UPDATE::

according to this example here on Identity email-authentication, installing the Visual Studio 2013 Update 2 allows users to complete registration with email, and NOT username:

enter image description here

Big yay.

2
  • Are you using ASP.NET Identity (MVC 5+) or Simple Membership (used in the link provided)? Commented Jun 2, 2014 at 20:58
  • Oops forgot to add that important detail. MVC 5. Commented Jun 2, 2014 at 20:59

2 Answers 2

1

The best way would be to create your own custom user validator. With a custom validator you can write your own logic to check if a user name is valid (in your case if the user name is an email address). This approach does not remove the user name from Identity, but it ensures that your user name is a valid email address.

An example how to implement one can be found here. Be aware that this solution was built upon Identity 1.0. Nevertheless, it should work the same way.

BTW, your link points to Simple Membership (as mentioned by @Anthony), not ASP.NET Identity as mentioned in the rest of your question.

EDIT

As mentioned in the comments, here's the answer again:

I haven't tried it yet, but I would guess that it is not possible when you're using the Entity Framework implementation. There the implementation uses the IdentityUser class which implements the IUser interface from Identity. Even the IUser interface contains a user name property.

Sign up to request clarification or add additional context in comments.

4 Comments

Ah, thank you for pointing that out about the SimpleMembership link. Is it not possible to alter the Identity registration requirements and completely replace username credential with email?
I haven't tried it yet, but I would guess that it is not possible when you're using the Entity Framework implementation. There the implementation uses the IdentityUser class which implements the IUser interface from Identity. Even the IUser interface contains a user name property.
that's what I needed to hear. Please repost comment as answer so I can accept it. Thank you both.
oh oops. I misread your comment and answer to be posted by two different people. I could have just accepted to get you those points. Thanks again!
1

UPDATE::

according to this example here on Identity email-authentication, installing the Visual Studio 2013 Update 2 allows (using MVC web template) users to complete registration with email, and NOT username:

enter image description here

Big yay.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.