在旧asp身份2.0,存在型Microsoft.AspNet.Identity.UserManager一个CreateIdentityAsync()方法。但现在asp 5消除了这种方法,我怎么可以创建一个ClaimsIdentity重新$ P $现在psenting用户?先谢谢了。
public虚拟任务< ClaimsIdentity> CreateIdentityAsync(TUSER用户,串authenticationType);解决方案
这是你在寻找什么?
aspnet-docs-example.readthedocs/en/latest/autoapi/Microsoft/AspNet/Identity/IUserClaimsPrincipalFactory-TUser/
IUserClaimsPrincipalFactory接口
提供了一个抽象的工厂从用户创建System.Security.Claims.ClaimsPrincipal。
In old asp identity 2.0, there is a CreateIdentityAsync() method in type Microsoft.AspNet.Identity.UserManager. But now asp 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?
aspnet-docs-example.readthedocs/en/latest/autoapi/Microsoft/AspNet/Identity/IUserClaimsPrincipalFactory-TUser/
IUserClaimsPrincipalFactory Interface
Provides an abstraction for a factory to create a System.Security.Claims.ClaimsPrincipal from a user.
更多推荐
如何创建asp.net 5 ClaimIdentity
发布评论