I am using IdentityServer4 v4.1.1 in a .Net Core 3.1 project and having issues with FindByNameAsync - it always returns null.
This works and returns the user:
var user = await userStore.Context.Users.FirstOrDefaultAsync(u => u.NormalizedUserName == userManager.NormalizeName(model.Username), default(CancellationToken));
This does not and returns null:
var user = await userStore.FindByNameAsync(userManager.NormalizeName(model.Username));
How is this possible?
Edit (in an effort to show my research):
The reason I am really confused about this is that I found the following in the .Net Core source: https://github.com/dotnet/aspnetcore/blob/main/src/Identity/EntityFrameworkCore/src/UserStore.cs#L255
It seems like both of these statements should do the exact same thing. I am hoping that someone can explain why they do not.