我正在将Web API项目从目标框架.net framework 4.6.1
迁移到.net core
。 API需要授权并使用Claimset来获取或设置遗留项目中请求的声明集合。
在旧项目中,使用System.IdentityModel
库中的ClaimSet,该库不适用于.net核心。
我尝试在.net核心中使用System.Security.Claims
库,但此库中没有ClaimSet属性。
我的问题是,.net核心中是否有ClaimSet
?如果是的话,我应该如何使用它?我需要使用哪个库来使用.net核心中的ClaimSet
?
答案 0 :(得分:0)
本身没有ClaimSet。您现在只需创建一个Enumerable<Claim>()
,即可在microsoft.netcore.app \ 2.2.0 \ ref \ netcoreapp2.2 \ System.Security.Claims.dll