Value cannot be null. Parameter name: value, CreateIdentityAsync?
I faced the same issue while upgrading from ASP.NET Identity 1 to ASP.NET Identity 2 and I solved it by putting a random string in the field SecurityStamp.
I found this solution here.
I hope it works for you too.
As Sam mentioned in his comment for the previous answer, my solution to this problem was to make sure that the user I was creating in in the Seed method of the EF Migration had something in the SecurityStamp
. Once I did that and did a update-database -force
, I was able to log in just fine.
context.Users.AddOrUpdate(u => u.UserName,
new ApplicationUser
{
UserName = "demo",
Email = "[email protected]",
EmailConfirmed = true,
PhoneNumberConfirmed = true,
PasswordHash = password,
PhoneNumber = "111-222-3344",
SecurityStamp = Guid.NewGuid().ToString() //THIS IS WHAT I NEEDED
});
If you created your user through some other means, you should be able to fix it by putting a string in the users db column via sql and have the same success.
In a similar way to Kevin, we were also experiencing this issue. It turns out that when seeding the database someone had forgotten to set the UserName
property which produced this same error.
I had a more generic issue - some of my claims had Null values in the AspNetUserClaims table after a sql upgrade routine had run.
I solved the issue by setting the ClaimValues to an empty string.