Quote from
matgar on April 27, 2018, 6:42 pm
I think I found it after stepping through after getting the github projects for the IdentityServer projects. Looks like it is in the ValidateAsync in the public virtual async Task ValidateAsync(ResourceOwnerPasswordValidationContext context)
{
var user = await _userManager.FindByNameAsync(context.UserName);
Add this line to:
var user = await _userManager.FindByNameAsync(context.UserName);
// This is where I made the change in order to check both username and/or email
if (user == null)
{
user = await _userManager.FindByEmailAsync(context.UserName);
}
I think I found it after stepping through after getting the github projects for the IdentityServer projects. Looks like it is in the ValidateAsync in the public virtual async Task ValidateAsync(ResourceOwnerPasswordValidationContext context)
{
var user = await _userManager.FindByNameAsync(context.UserName);
Add this line to:
var user = await _userManager.FindByNameAsync(context.UserName);
// This is where I made the change in order to check both username and/or email
if (user == null)
{
user = await _userManager.FindByEmailAsync(context.UserName);
}