是否有可能在ASP.NET Core 2中支持多个JWT令牌发行者?我想为外部服务提供API,我需要使用两个JWT令牌源 - Firebase和自定义JWT令牌发行者.在ASP.NET核心中,我可以为Bearer身份验证方案设置JWT身份验证,但仅限于一个权限:
services
.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddJwtBearer(options =>
{
options.Authority = "https://securetoken.google.com/my-firebase-project"
options.TokenValidationParameters = new TokenValidationParameters
{
ValidateIssuer = true,
ValidIssuer = "my-firebase-project"
ValidateAudience = true,
ValidAudience = "my-firebase-project"
ValidateLifetime = true
};
}
Run Code Online (Sandbox Code Playgroud)
我可以有多个发行人和受众,但我不能设置多个权限.
jwt asp.net-core-mvc firebase-authentication asp.net-core-2.0