具有 SAML 2.0 作为 SSO 的外部身份提供者的身份服务器 4

Identity server 4 with SAML 2.0 as external identity provider for SSO

我正在使用身份服务器 4 对我的 ASP.Net 核心解决方案进行身份验证。它与 Facebook、Google 和其他外部身份提供商合作良好。 现在我正在尝试使用来自 https://github.com/Sustainsys/Saml2 的 Sustainsys.Saml2 将 SAML 2.0 身份验证添加到身份服务器,并使其作为外部身份提供者工作。 (我们网站的客户希望使用我们的身份服务器使用他们的 SAML 身份提供商登录,就像他们可以通过 Facebook、Google 等登录一样)

而我现在拥有的是

  1. 登录URL - https://sso.domain.com/saml/idp/profile/redirectorpost/sso

  2. 退出 URL - https://sso.domain.com/saml/idp/profile/post/sls

  3. CRT证书 对于我们客户的基于 SAML 的身份提供者。

但是,我找不到描述如何在身份服务器 4 startup.cs 文件中设置 SAML 2.0 配置的文档。 我认为根据可用的示例,配置应如下所示: https://github.com/Sustainsys/Saml2/blob/master/Samples/SampleAspNetCore2ApplicationNETFramework/Startup.cs

services.AddAuthentication()
    .AddSaml2(options => 
        {
            options.SPOptions.EntityId = new EntityId("..."); 
            options.IdentityProviders.Add(
                new IdentityProvider(
                        new EntityId("..."), options.SPOptions)
                        {
                            LoadMetadata = true,
                        });
            options.SPOptions.ServiceCertificates.Add(new X509Certificate2("..."));
       }
    );

样本中有两个url的

  1. https://localhost:44342/Saml2

  2. http://localhost:52071/Metadata

这些代表什么

有人能告诉我如何在身份服务器 4 中设置 SAML2 的所有选项吗?

  1. 是您的应用程序的实体 ID - 对应于 open id connect 中的客户端 ID。
  2. 是上游idp的实体id。

另一个分支中有一个示例 IdSrv4:https://github.com/Sustainsys/Saml2/tree/netstandard/Samples/SampleIdentityServer4

该示例使用 .NET Core 的预览版,但配置基本相同。

https://github.com/Sustainsys/Saml2/tree/master/Samples

中有可用的 IdentityServer4 样本