本文介绍了如何创建asp.net 5 ClaimIdentity的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在旧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?

http://aspnet-docs-example.readthedocs.org/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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-11 23:21