如何创建asp.net 5 ClaimIdentity

编程入门 行业动态 更新时间:2024-10-27 20:24:49
本文介绍了如何创建asp 5 ClaimIdentity的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

本文发布于:2023-11-05 21:28:27,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1561904.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:asp   net   ClaimIdentity

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!