我可以帮您进行翻译。以下是需要翻译的内容:
我有一个使用多个绑定(auth.company1.com和auth.company2.com)托管的IDP(Identity Server 4)。我还有一个被该IDP保护的API。因此,为了访问API,我需要从IDP获得访问令牌。这是在API级别的启动类中配置的,如下所示:
services.AddAuthentication("Bearer")
.AddIdentityServerAuthentication(options =>
{
options.Authority = "https://auth.company1.com/";
options.RequireHttpsMetadata = true;
options.ApiName = "atb_api";
});
如何动态配置options.Authority,以使其允许来自多个域名的授权 https://auth.company1.com/ 和 https://auth.company2.com/ ?
config.TokenValidationParameters.IssuerValidator
。 根据项目文档,提供AddIdentityServerAuthentication的包似乎不再维护。 - nod