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;取消这个验证