To create a ClaimsPrincipal object from a TUser object, you can import IUserClaimsPrincipalFactory<TUser> into your own code and call CreateAsync :
var principal = await factory.CreateAsync(user);
Alternatively, you can also use the UserManager<TUser>.GetClaimsAsync - something that UserClaimsPrincipalFactory<TUser> uses behind the scenes - and create the ClaimsIdentity yourself:
var identity = new ClaimsIdentity(await manager.GetClaimsAsync(user), authenticationType);
Pinpoint Nov 04 '15 at 20:21 2015-11-04 20:21
source share