Relative Content

Tag Archive for c#asp.net-coreidentityserver4

Change IdentityUser key from string to GUID – UserManager no longer works

I’ve recently decided to switch from string to GUID as the unique identifier for the IdentityUser. I have successfully applied the migration to the database, but now the UserManager methods don’t work anymore. Finding a user by email with the DbContext works fine (DataContext.Users.SingleAsync(...)) but returns null with UserManager(UserManager.FindByIdAsync(...))