0

我正在使用 .NET 框架构建一个 ASP.NET MVC 应用程序。

在我Get()的控制器中,我调用

var bootstrapContext = ClaimsPrincipal.Current.Identities.First().BootstrapContext.ToString();

但我看到它BootstrapContext为空,但ClaimsPrincipal.Current.Identities已填充。

在 ClaimsIdentity 上读到 BootstrapContext 为空。在我的Startup.cs,我添加了SaveSigninToken = true

BootstrapContext仍然为空。

我尝试添加

<system.identityModel>
    <identityConfiguration saveBootstrapContext="true" />
</system.identityModel>

Views/Web.config我得到一个错误

无法识别的配置部分 system.identityModel

4

0 回答 0