This commit is contained in:
Andrew White 2024-08-18 12:25:30 -06:00 коммит произвёл GitHub
Родитель 901ebdd4a2
Коммит a221f315e3
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 7 добавлений и 2 удалений

Просмотреть файл

@ -142,6 +142,7 @@ work.
}
]
}
}
```
## Other Authentication Options
@ -161,8 +162,12 @@ builder.Services.AddMultiTenant<TenantInfo>()
.WithRouteStrategy()
.WithPerTenantAuthentication()
// WithPerTenantAuthentication, as shown above, is needed for this to work as intended
builder.Services.ConfigurePerTenant<JwtBearerOptions, TenantInfo>((options, tenantInfo) =>
// WithPerTenantAuthentication, as shown above, is needed for this to work as intended.
// Note the default JwtBearer authentication scheme is used for the options name per AspNetCore defauls,
// but you can use a custom authentication scheme name to scope the options or use ConfigureAllPerTenant
// to impact all authentication schemes.
builder.Services.ConfigurePerTenant<JwtBearerOptions, TenantInfo>(JwtBearerDefaults.AuthenticationScheme, (options,
tenantInfo) =>
{
// assume tenants are configured with an authority string to use here.
options.Authority = tenantInfo.JwtAuthority;