What is a replacement for the CreateIdentityAsync method in RTM Asp.Net Core 1.0?

In ASP.NET Core1.0 RTM, I am trying to create Identity using this method:

userManager.CreateIdentityAsync() 

but I get this error:

"UserManager" does not contain a definition for "CreateIdentityAsync".

What is going wrong?

+7
source share
3 answers

You can try IUserClaimsPrincipalFactory

 ClaimsPrincipal claimsPrincipal = await _claimsPrincipalFactory.CreateAsync(user); ((ClaimsIdentity) claimsPrincipal.Identity).AddClaim(new Claim("user_id", user.Id.ToString())); 
+2
source

Try this: signInManager.SignInAsync(user, false);

0
source

I am using ClaimsIdentityFactory() . Here is my code:

 public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<ApplicationUser> manager, string AuthenticationType) { var factory = new ClaimsIdentityFactory<ApplicationUser>(); return await factory.CreateAsync(manager, this, AuthenticationType); } 
-1
source

All Articles