当我使用OWIN在ASP.NET Identity中从外部登录获得外部声明时,是否需要将外部声明更改或映射到内部声明,以便可以使用ClaimsPrincipal.Current的声明?
public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<ApplicationUser> manager)
{
var identity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);
identity.AddClaim(new Claim("FirstName", FirstName ?? ""));
identity.AddClaim(new Claim("LastName", LastName ?? ""));
identity.AddClaim(new Claim("IsAuthenticated", "true"));
identity.AddClaim(new Claim("ID", ID.ToString()));
return identity;
}