Integration testing ASP.NET WebAPI controllers that use bearer authentication with identityserver3
问题 I'm trying to integration test my web api controllers. The application uses JWTs to authenticate users against the resource server. To spool up the application, I'm using the TestServer found in Microsoft.OWIN.Testing. I can obtain a valid JWT by performing a login as a browser would do. I then proceed to add the JWT to the request as follows: request.AddHeader("Authorization", "Bearer " + accessToken.RawData); That header also arrives in the OWIN pipeline. However, all controllers protected