0

I'm trying to set the allowed characters in asp .net core identity. I have the following setting in my startup.cs file:

options.User.AllowedUserNameCharacters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-@._+";

I'm trying to set my user name to the supplied email address. In debugging, my email address is coming through properly. Any insight into what I should set on this?

I've been through this link.

Wallace B. McClure
  • 1,165
  • 1
  • 15
  • 31
  • Your question doesn't state what the problem is. You indicate it is coming through properly, so what is the issue? – Abraham Lincoln Sep 22 '20 at 17:02
  • Apologies on not being specific enough. :-) The error message is coming back when I attempt to call the UserManager's CreateAsync Method. I've tried various versions of passing an AspNetUser object with various properties. The error happens no matter what properties I fill in. var user = new AspNetUser() { Id = Guid.NewGuid().ToString(), UserName = UserName, NormalizedUserName = UserName.ToUpper(), NormalizedEmail = UserName.ToUpper(), Email = UserName }; var userCreate = await _userManager.CreateAsync(user); – Wallace B. McClure Sep 23 '20 at 17:26

0 Answers0