static async Task OnChallenge(JwtBearerChallengeContext context) { Debug.WriteLine($"55. Begin {nameof(JwtBearerMiddlewareDiagnostics.OnChallenge)}"); await JwtBearerMiddlewareDiagnostics.onChallenge(context); Debug.WriteLine($"55. End - {nameof(JwtBearerMiddlewareDiagnostics.OnChallenge)}"); }
static async Task OnTokenValidated(TokenValidatedContext context) { Debug.WriteLine($"2. Begin {nameof(JwtBearerMiddlewareDiagnostics.OnTokenValidated)}"); await JwtBearerMiddlewareDiagnostics.onTokenValidated(context); Debug.WriteLine($"2. End - {nameof(JwtBearerMiddlewareDiagnostics.OnTokenValidated)}"); }
static async Task OnAuthenticationFailed(AuthenticationFailedContext context) { Debug.WriteLine($"99. Begin {nameof(JwtBearerMiddlewareDiagnostics.OnAuthenticationFailed)}"); // Place a breakpoint here and examine context.Exception await JwtBearerMiddlewareDiagnostics.onAuthenticationFailed(context); Debug.WriteLine($"99. End - {nameof(JwtBearerMiddlewareDiagnostics.OnAuthenticationFailed)}"); }
static async Task OnMessageReceived(MessageReceivedContext context) { Debug.WriteLine($"1. Begin {nameof(JwtBearerMiddlewareDiagnostics.OnMessageReceived)}"); // Place a breakpoint here and examine the bearer token (context.Request.Headers.HeaderAuthorization / context.Request.Headers["Authorization"]) // Use https://jwt.ms to decode the token and observe claims await JwtBearerMiddlewareDiagnostics.onMessageReceived(context); Debug.WriteLine($"1. End - {nameof(JwtBearerMiddlewareDiagnostics.OnMessageReceived)}"); }