Identity Server 4 Claims empty on API

后端 未结 2 946
梦毁少年i
梦毁少年i 2020-12-21 07:51

I have been trying to Integrate Identity Server 4 with SPA application. I am able to Authorize the Application in API but after the authorization the User.Claims

2条回答
  •  借酒劲吻你
    2020-12-21 08:52

    Try this

    var user = User.Claims.First(claim => claim.Type=="Name").Value(); 
    

    I am not an expert , but I think this is how you should work with Claims instead of the older versions of Asp.Net where placing User sufficed

提交回复
热议问题