Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/273.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# 如何在.net core中的每个请求上检查LockoutEnabled_C#_Asp.net Core_.net Core_Jwt - Fatal编程技术网

C# 如何在.net core中的每个请求上检查LockoutEnabled

C# 如何在.net core中的每个请求上检查LockoutEnabled,c#,asp.net-core,.net-core,jwt,C#,Asp.net Core,.net Core,Jwt,我正在使用jwt从我的angular UI对用户进行身份验证。 这是我在startup中运行良好的代码。 但我想在每个请求上检查lockoutEnabled并强制锁定的用户注销 services.AddAuthentication(x => { x.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; x.DefaultChallengeSch

我正在使用jwt从我的angular UI对用户进行身份验证。 这是我在startup中运行良好的代码。 但我想在每个请求上检查lockoutEnabled并强制锁定的用户注销

 services.AddAuthentication(x =>
        {
            x.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
            x.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
        })
                     .AddJwtBearer(x =>
                     {
                         x.RequireHttpsMetadata = false;
                         x.SaveToken = true;
                         x.TokenValidationParameters = new TokenValidationParameters
                         {
                             RequireExpirationTime = true,
                             ValidateLifetime = true,
                             ClockSkew = TimeSpan.Zero,
                             ValidateIssuerSigningKey = true,
                             IssuerSigningKey = new SymmetricSecurityKey(Encoding.ASCII.GetBytes(AppConfig.JWT_SECRET_KEY)),
                             ValidateIssuer = false,
                             ValidateAudience = false
                         };

                     });

为什么每次请求都要检查它?您可以设置注销用户的时间,请检查