【问题标题】:How do implement multi domain Identity server?如何实现多域身份服务器?
【发布时间】:2020-11-20 14:23:24
【问题描述】:

我有一个问题!.. 我需要使用 N-tenant 及其身份验证提供程序(Azure AD all..)实现 IdentityServer。 例如: 租户 1 ... AzureAD-1 租户 2 ... AzureAD-2 租户 3 ... AzureAD-3 (...) TenantN ... 重定向 AzureAD-N 有可能吗? 另外,我需要从数据库中获取租户信息(它是clientId、client secret、callbackPath等)。 我的第一种方法是:

public class Startup
{
    public void ConfigureServices(IServiceCollection services)
    {
    (...)
        IEnumerable<AuthenticationSchema> schemas = repository.GetAuthenticationSchemas();
        
        if (schemas != null && schemas.Count() > 0)
        {
            foreach (AuthenticationSchema schema in schemas)
                builder.AddOpenIdConnect(schema.Id, options =>
                {
                    options.Authority = schema.Authority;
                    options.TokenValidationParameters = new TokenValidationParameters { ValidateIssuer = false };
                    options.ClientId = schema.ClientId;
                    options.ClientSecret = schema.ClientSecret;
                    options.CallbackPath = schema.CallBackPath;
                   
                });
        }
    (...)
    } 
}

这种方法有一个问题,如果我在数据库中添加一个新的 openidconnect,我需要重置服务器,因为注册是在启动应用程序中..

是否可以动态地做到这一点? 他们可以帮助我吗?

【问题讨论】:

    标签: azure-active-directory identityserver4 multi-tenant


    【解决方案1】:

    我认为您可以通过多租户应用程序更好地解决业务需求,这里有一些资源可以帮助您处理多租户应用程序。

    1. Authentication flows and application scenarios
    2. Sign in any Azure Active Directory user using the multi-tenant application pattern
    3. Code sample
    4. Recorded walkthrough

    【讨论】:

      猜你喜欢
      • 2016-08-05
      • 2016-04-19
      • 2023-03-09
      • 1970-01-01
      • 2017-11-26
      • 2017-04-07
      • 1970-01-01
      • 1970-01-01
      • 2016-12-26
      相关资源
      最近更新 更多