2

I have setup multi-authority jwt token validation in .net core app. Everything is working as expected but we are noticing some noise in our application logs where the validation failed event getting logged for the jwtbearer authentication provider. Each request can either be validated by one of the token validators and the other one validation fails. Is there a way to suppress the event when one of the token validation passes the validation?

services.AddAuthentication("AzureAdAuth").AddJwtBearer("AzureAdAuth", options =>
            {                
                configuration.Bind("JwtSettings:AzureAd", options);
            })
            .AddJwtBearer("WebSecAuth", options =>
            {
                configuration.Bind("JwtSettings:WebSec", options);
                options.Events = new JwtBearerEvents()
                {
                    OnAuthenticationFailed = _ => {
                        return Task.CompletedTask;
                    }
                };
            });
Manish Rawat
  • 1,142
  • 1
  • 18
  • 34

0 Answers0