Unable to Retrieve Claims in .NET Core 2.0

前端 未结 2 1436
借酒劲吻你
借酒劲吻你 2021-02-09 05:34

I am using an OpenId Connect Authentication Server, specifically Identity Server 4 (version 1.5.2) on .NET Core 1.1. I have this running with ASP.NET

2条回答
  •  忘了有多久
    2021-02-09 06:02

    ASP.NET Core 2 introduced a ClaimActions property to the OpenIdConnectionOptions. The default collection of ClaimActions will remove the claims you are looking for. You can get the claims back by clearing ClaimActions on your options object:

    options.ClaimActions.Clear();
    

    See also: https://leastprivilege.com/2017/11/15/missing-claims-in-the-asp-net-core-2-openid-connect-handler/

提交回复
热议问题