identity server4里遇到:User name '' is invalid, can only contain letters or digits的解决方式


        private readonly UserManager<IdentityUser> _userManager;
        private readonly RoleManager<IdentityRole> _roleManager;
        public HomeController(IIdentityServerInteractionService interaction, UserManager<IdentityUser> userManager, RoleManager<IdentityRole> roleManager, IWebHostEnvironment environment)
        {
            _roleManager = roleManager;
            _userManager = userManager;
            _interaction = interaction;
            Environment = environment;

 _roleManager.RoleValidators.Clear(); userManager.UserValidators.Clear();
        }

_roleManager.RoleValidators.Clear();
userManager.UserValidators.Clear();

上面的就是把验证的机制去掉,就允许中文了


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM