nginx 401 token netcore

nginx做转换时,能获取到token,但获取数据时,却提示401,需要在startup.cs中,增加

services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
               .AddJwtBearer(options =>
               {
                   options.RequireHttpsMetadata = false;
                   options.Authority = Configuration["AuthorityUrl"];
                   options.Audience = "monitorapi";
                   //是否验证Issuer
                   options.TokenValidationParameters.ValidateIssuer = false;
               });
options.TokenValidationParameters.ValidateIssuer = false;取消这个验证
posted @ 2021-10-26 10:20  天天的蓝色  阅读(645)  评论(0编辑  收藏  举报