问题描述
在旧asp.net身份2.0,存在型Microsoft.AspNet.Identity.UserManager一个CreateIdentityAsync()方法。但现在asp.net 5消除了这种方法,我怎么可以创建一个ClaimsIdentity重新$ P $现在psenting用户?先谢谢了。
public虚拟任务< ClaimsIdentity> CreateIdentityAsync(TUSER用户,串authenticationType);
这是你在寻找什么?
http://aspnet-docs-example.readthedocs.org/en/latest/autoapi/Microsoft/AspNet/Identity/IUserClaimsPrincipalFactory-TUser/
IUserClaimsPrincipalFactory接口
提供了一个抽象的工厂从用户创建System.Security.Claims.ClaimsPrincipal。
In old asp.net identity 2.0, there is a CreateIdentityAsync() method in type Microsoft.AspNet.Identity.UserManager. But now asp.net 5 has removed this method, how can I create a ClaimsIdentity representing the user now? Thanks in advance.
public virtual Task<ClaimsIdentity> CreateIdentityAsync(TUser user, string authenticationType);
Is this what you are looking for?
IUserClaimsPrincipalFactory Interface
Provides an abstraction for a factory to create a System.Security.Claims.ClaimsPrincipal from a user.
这篇关于如何创建asp.net 5 ClaimIdentity的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!