2
我试着去得到一个访问令牌,而做到这一点,我需要这行:asp.net核心ControllerBase.User没有实现控制器
string userId = User.FindFirst("http://schemas.microsoft.com/identity/claims/objectidentifier").Value;
但是,除非我实现Controller
无法找到User
。我试过HttpContext.User
还有一些其他的东西。
它来自ControllerBase
,看起来像public ClaimsPrincipal User { get; }
。有没有办法让这个在一个正常的类与进口?