context.Request.User is null in OWIN OAuthAuthorizationServerProvider

前端 未结 1 1914
情书的邮戳
情书的邮戳 2021-02-06 14:11

I\'m trying to implement OAuth using OWIN for a Web API v2 endpoint on my local intranet. The API is hosted in IIS using built-in Windows Authentication. In short, this is wha

相关标签:
1条回答
  • 2021-02-06 14:40

    Swap the order of UseOAuthAuthorizationServer and UseOAuthBearerAuthentication. UseOAuthBearerAuthentication calls UseStageMarker(PipelineStage.Authenticate); to make it (and everything before it) run earlier in the ASP.NET pipeline. User is null when you run during the Authenticate stage.

    0 讨论(0)
提交回复
热议问题