Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 每当多个JWT承载身份验证注册ASP.NET核心时,都会引发OnAuthenticationFailed事件_C#_Asp.net_.net_Asp.net Core_.net Core - Fatal编程技术网

C# 每当多个JWT承载身份验证注册ASP.NET核心时,都会引发OnAuthenticationFailed事件

C# 每当多个JWT承载身份验证注册ASP.NET核心时,都会引发OnAuthenticationFailed事件,c#,asp.net,.net,asp.net-core,.net-core,C#,Asp.net,.net,Asp.net Core,.net Core,我已经在.net核心应用程序中设置了多权限jwt令牌验证。一切都按预期工作,但我们注意到应用程序日志中存在一些噪音,其中jwtbearer身份验证提供程序记录了验证失败事件。每个请求都可以由一个令牌验证器进行验证,而另一个验证失败。当其中一个令牌验证通过验证时,是否有方法抑制事件 services.AddAuthentication("AzureAdAuth").AddJwtBearer("AzureAdAuth", options => {

我已经在.net核心应用程序中设置了多权限jwt令牌验证。一切都按预期工作,但我们注意到应用程序日志中存在一些噪音,其中jwtbearer身份验证提供程序记录了验证失败事件。每个请求都可以由一个令牌验证器进行验证,而另一个验证失败。当其中一个令牌验证通过验证时,是否有方法抑制事件

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;
                    }
                };
            });

这有用吗?不有了这个问题,我就能够找出如何建立多个令牌提供者。这有帮助吗?不有了这个问题,我就知道了如何建立多个令牌提供者。。