本文整理汇总了C#中ApplicationUserManager.CreateIdentityAsync方法的典型用法代码示例。如果您正苦于以下问题:C# ApplicationUserManager.CreateIdentityAsync方法的具体用法?C# ApplicationUserManager.CreateIdentityAsync怎么用?C# ApplicationUserManager.CreateIdentityAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ApplicationUserManager
的用法示例。
在下文中一共展示了ApplicationUserManager.CreateIdentityAsync方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegenerateIdentityCallback
/// <summary>
/// Regenerates the identity callback function for cookie configuration (above).
/// </summary>
/// <param name="applicationUserManager">The application user manager.</param>
/// <param name="applicationUser">The application user.</param>
private static async Task<ClaimsIdentity> RegenerateIdentityCallback(ApplicationUserManager applicationUserManager, ApplicationUser applicationUser)
{
// Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType
var userIdentity = await applicationUserManager.CreateIdentityAsync(applicationUser, DefaultAuthenticationTypes.ApplicationCookie);
// Add custom user claims here
return userIdentity;
}
示例2: GenerateUserIdentityAsync
public static async Task<ClaimsIdentity> GenerateUserIdentityAsync(this Participant usr,ApplicationUserManager manager, string authenticationType)
{
// Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType
var userIdentity = await manager.CreateIdentityAsync(usr, authenticationType);
// Add custom user claims here
return userIdentity;
}
示例3: GenerateUserIdentityAsync
public async Task<ClaimsIdentity> GenerateUserIdentityAsync(ApplicationUserManager manager)
{
// Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType
var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);
// Add custom user claims here
return userIdentity;
}
示例4: GenerateUserIdentityAsync
public async Task<ClaimsIdentity> GenerateUserIdentityAsync(ApplicationUserManager manager, string authType)
{
var userIdentity = await manager.CreateIdentityAsync(this, authType);
// Add custom user claims here
return userIdentity;
}
示例5: GenerateUserIdentityAsync
public async Task<ClaimsIdentity> GenerateUserIdentityAsync(ApplicationUserManager userManager,
string authenticationType)
{
var userIdentity = await userManager.CreateIdentityAsync(this, authenticationType);
return userIdentity;
}
示例6: GenerateUserIdentityAsync
public Task<ClaimsIdentity> GenerateUserIdentityAsync(ApplicationUserManager manager, User user)
{
return manager.CreateIdentityAsync(user, "UPlayAgainAuth");
}