【发布时间】:2016-10-24 22:44:05
【问题描述】:
我正在使用标准的 owin asp.net.identity 机制来授权用户使用他们的访问令牌。在我的控制器内部,我想知道是谁发送了请求。我怎么能做到?我能否以某种方式从控制器内部的请求中检索访问令牌?
我试过了:
public HttpResponseMessage Get([FromUri] GetParameters parameters)
{
Var identity = RequestContext.Principal.Identity;
}
它并没有给我很多,因为大多数属性总是空的。
【问题讨论】:
标签: c# asp.net-web-api asp.net-identity