Skip to content

Web API Troubleshooting

Jean-Marc Prieur edited this page Jul 13, 2020 · 5 revisions

To troubleshoot your web API, you can set the subscribeToJwtBearerMiddlewareDiagnosticsEvents optional boolean to true when you call AddMicrosoftWebApiAuthentication or AddMicrosoftWebApi (used to be AddProtectedWebApi in Microsoft.Identity.Web 0.1.x). Enabling these diagnostics displays in the output window the progression of the OAuth 2.0 message through the JWTBearer middleware (from the reception of the message from Azure Active directory to the availability of the user identity in HttpContext.User).

JwtBearerMiddlewareDiagnostics

In both cases, you can set a breakpoint in the methods of the OpenIdConnectMiddlewareDiagnostics and JwtBearerMiddlewareDiagnostics classes respectively to observe values in the debugger.

Getting started with Microsoft Identity Web

Token cache serialization

Web apps

Web APIs

Daemon scenario

Advanced topics

Extensibility

Credential providers

FAQ

News

Contribute

Other resources

Clone this wiki locally