// 使用者
public class User
{
public int ID {get;set}
public string Name {get;set;}
public string Password {get;set;}
}
// 覆蓋ClaimsIdentity
private ClaimsIdentity CreateIdentity(User user, string authenticationType)
ClaimsIdentity _identity = new ClaimsIdentity(DefaultAuthenticationTypes.ApplicationCookie);
_identity.AddClaim(new Claim(ClaimTypes.Name, user.Name));
_identity.AddClaim(new Claim("http://schemas.microsoft.com/accesscontrolservice/2010/07/claims/identityprovider", "ASP.NET Identity"));
return _identity;
// 使用者
public class User
{
public int ID {get;set}
public string Name {get;set;}
public string Password {get;set;}
}
// 覆蓋ClaimsIdentity
private ClaimsIdentity CreateIdentity(User user, string authenticationType)
{
ClaimsIdentity _identity = new ClaimsIdentity(DefaultAuthenticationTypes.ApplicationCookie);
_identity.AddClaim(new Claim(ClaimTypes.Name, user.Name));
_identity.AddClaim(new Claim("http://schemas.microsoft.com/accesscontrolservice/2010/07/claims/identityprovider", "ASP.NET Identity"));
return _identity;
}