【问题标题】:identity server 4 using multiple external identity providers使用多个外部身份提供者的身份服务器 4
【发布时间】:2017-02-02 16:30:52
【问题描述】:

我想将身份服务器 4 与一堆不同的外部身份提供者一起使用。不止一个。 例如:一家企业可能将 ADFS 用于他们的 EIP,另一家企业将使用 AZURE 身份等等。在这种情况下,只有一个身份服务器实例访问不同的外部 ID 提供者。

这可能吗,或者有没有人尝试过。如果没有,你知道有这样的服务吗?

【问题讨论】:

    标签: identityserver4


    【解决方案1】:

    这当然是可能的。您可以在 Startup 类中注册任意数量的外部 IdP。请务必查看来自 Identityserver 的示例快速入门存储库。

    此代码会将 AzureAd 和 Google 注册为外部 IdP。 在进行设置之前,您必须在 developers.google 和 AzureAd 中注册您的应用程序以授权您的应用程序。

        app.UseOpenIdConnectAuthentication(new OpenIdConnectOptions
        {
            ClientId = Configuration["AzureAd:clientid"],
            Authority = Configuration["AzureAd:authority"],
            ClientSecret = Configuration["AzureAd:secret"],
            PostLogoutRedirectUri = "/signed-out",
            AuthenticationScheme = "AzureAd",
            ResponseType = OpenIdConnectResponseType.CodeIdToken,
            SaveToken = true,
        });
    
        app.UseGoogleAuthentication(new GoogleOptions
        {
            ClientId = Configuration["Google:clientid"],
            ClientSecret = Configuration["Google:secret"],
            AuthenticationScheme = "Google",
            SaveTokens = true
        });
    

    【讨论】:

    • 与finbuckle有什么关系?
    猜你喜欢
    • 2018-08-10
    • 1970-01-01
    • 2013-06-07
    • 2017-08-12
    • 1970-01-01
    • 2018-04-05
    • 2020-09-03
    • 2016-10-24
    • 2022-06-16
    相关资源
    最近更新 更多