ASP.NET identity use email instead of user name

daniel

How can I use email instead of user name in the new ASP.NET identity system?

I tried to change the RegisterViewModel class:

[Display(Name = "Email address")]
[Required(ErrorMessage = "The email address is required")]
[EmailAddress(ErrorMessage = "Invalid Email Address")]
public string UserName { get; set; }

but when I enter an mail adress I am getting the error:

User name [email protected] is invalid, can only contain letters or digits.
meda

You have 2 options to solve it by either turning off that validator, or create your own UserValidator.

You could turn it off like this:

UserManager.UserValidator = new UserValidator<TUser>(UserManager) 
                                    { 
                                       AllowOnlyAlphanumericUserNames = false 
                                    };

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How do I use ASP.NET Identity 2.0 to allow a user to impersonate another user?

From Dev

Why does Logout in ASP.NET Identity use POST instead of GET?

From Dev

Use Username instead of Email for identity in Asp.net mvc5

From Dev

How to Mock HttpContext.User.Identity.Name in Asp.Net MVC 4

From Dev

ASP.NET Identity User and Roles in Multisite

From Dev

Add user First Name and Last Name to an ASP.NET Identity 2?

From Dev

How do you use the Confirm Email functionality in ASP.NET Identity 2.0

From Dev

How should I add a user email address for a user with ASP.NET Identity 2

From Dev

ASP.Net Identity not creating user

From Dev

Identity email with dash in Asp.Net Identity

From Dev

Asp.net Identity 2.0 - Unique Email

From Dev

Not able to get the Windows User Name using 'User.Identity.Name' in ASP.NET

From Dev

Asp.Net Identity save user without email

From Dev

ASP.NET Identity : Prevent the user to Sign In without email confirmation

From Dev

How to login with "username" instead of "email address" in ASP.Net Web Forms Identity

From Dev

ASP.NET Identity Confirmation Email Is Plain Text Instead of HTML

From Dev

Asp.net Identity 2 custom user and custom table name

From Dev

Set email as username in ASP.NET Identity

From Dev

How do I change an ASP.NET Identity user's email WITHOUT requiring an email confirmation?

From Dev

How to Mock HttpContext.User.Identity.Name in Asp.Net MVC 4

From Dev

Asp.net identity extra user information like email etc

From Dev

Add user First Name and Last Name to an ASP.NET Identity 2?

From Dev

How should I add a user email address for a user with ASP.NET Identity 2

From Dev

Not able to get the Windows User Name using 'User.Identity.Name' in ASP.NET

From Dev

How to login with "username" instead of "email address" in ASP.Net Web Forms Identity

From Dev

Set email as username in ASP.NET Identity

From Dev

How to get logged-in user name in the constructor of a controller in ASP.NET Core Identity

From Dev

Create user in asp.net c# identity doesn't work with Hebrew user name

From Dev

Showing User Names (stored in ASP.Net Core Identity system), instead of IDs When loading a table

Related Related

  1. 1

    How do I use ASP.NET Identity 2.0 to allow a user to impersonate another user?

  2. 2

    Why does Logout in ASP.NET Identity use POST instead of GET?

  3. 3

    Use Username instead of Email for identity in Asp.net mvc5

  4. 4

    How to Mock HttpContext.User.Identity.Name in Asp.Net MVC 4

  5. 5

    ASP.NET Identity User and Roles in Multisite

  6. 6

    Add user First Name and Last Name to an ASP.NET Identity 2?

  7. 7

    How do you use the Confirm Email functionality in ASP.NET Identity 2.0

  8. 8

    How should I add a user email address for a user with ASP.NET Identity 2

  9. 9

    ASP.Net Identity not creating user

  10. 10

    Identity email with dash in Asp.Net Identity

  11. 11

    Asp.net Identity 2.0 - Unique Email

  12. 12

    Not able to get the Windows User Name using 'User.Identity.Name' in ASP.NET

  13. 13

    Asp.Net Identity save user without email

  14. 14

    ASP.NET Identity : Prevent the user to Sign In without email confirmation

  15. 15

    How to login with "username" instead of "email address" in ASP.Net Web Forms Identity

  16. 16

    ASP.NET Identity Confirmation Email Is Plain Text Instead of HTML

  17. 17

    Asp.net Identity 2 custom user and custom table name

  18. 18

    Set email as username in ASP.NET Identity

  19. 19

    How do I change an ASP.NET Identity user's email WITHOUT requiring an email confirmation?

  20. 20

    How to Mock HttpContext.User.Identity.Name in Asp.Net MVC 4

  21. 21

    Asp.net identity extra user information like email etc

  22. 22

    Add user First Name and Last Name to an ASP.NET Identity 2?

  23. 23

    How should I add a user email address for a user with ASP.NET Identity 2

  24. 24

    Not able to get the Windows User Name using 'User.Identity.Name' in ASP.NET

  25. 25

    How to login with "username" instead of "email address" in ASP.Net Web Forms Identity

  26. 26

    Set email as username in ASP.NET Identity

  27. 27

    How to get logged-in user name in the constructor of a controller in ASP.NET Core Identity

  28. 28

    Create user in asp.net c# identity doesn't work with Hebrew user name

  29. 29

    Showing User Names (stored in ASP.Net Core Identity system), instead of IDs When loading a table

HotTag

Archive