0
PhilWynn created
Hi,
We have a requirement to use email address as User Name.
However, the User Name seems to be restricted to alpha numeric characters only, hence preventing email addresses containing hyphens.
What is the reason for this? Is it possible to override this restriction?
Many thanks.
Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)
4 Answer(s)
-
0
Hi @philwynn
If you are using ASP.NET Core, you can modify AddAbpIdentity like below;
services.AddAbpIdentity<Tenant, User, Role>(options => { // .... options.User.AllowedUserNameCharacters += @"\"; // doesn't work })Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi,
Sorry, should have mentioned, I am using MVC, jQuery version (Abp v3.8.3)
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
1
Answered in this SO question:
<blockquote>
This is the default behaviour of ASP.NET (Core) Identity.
You can do the following to disable validation.
ASP.NET Core Identity
IdentityRegistrar.cs:
return services.AddAbpIdentity<Tenant, User, Role>(options => { options.User.AllowedUserNameCharacters = null; })ASP.NET Identity (MVC 5)
UserManager.cs:
(UserValidator as Microsoft.AspNet.Identity.UserValidator<User, long>) .AllowOnlyAlphanumericUserNames = false;</blockquote>
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Thank you. That solved it...
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)