我正在尝试将Ocelot与IS4配合使用https://ocelot.readthedocs.io/en/latest/features/authentication.html
使用时
public void ConfigureServices(IServiceCollection services)
{
var authenticationProviderKey = "TestKey";
services.AddAuthentication()
.AddJwtBearer(authenticationProviderKey, x =>
{
});
}
并在ocelot.json中使用“ TestKey”,启动应用程序时会引发错误
无法启动Ocelot,错误是:TestKey,AllowedScopes:[]是不受支持的身份验证提供程序
知道有什么问题吗?我是否需要在IdentityServer应用中特别设置一些内容?
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddJwtBearer(options =>
{
// base-address of your identityserver
options.Authority = "https://demo.identityserver.io";
// name of the API resource
options.Audience = "api1";
});