使用SAML 2.0作为外部身份提供者的Identity Server 4用于单点登录

18

我正在使用Identity Server 4来对我的ASP.Net Core解决方案进行身份验证。它与Facebook、Google和其他外部身份提供程序的集成运行良好。

现在,我正在尝试使用Sustainsys.Saml2将SAML 2.0身份验证添加到Identity Server,并将其作为外部身份提供者进行工作(我们网站的客户希望使用他们的SAML身份提供者通过我们的Identity Server登录,就像他们可以通过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的身份提供者。

然而,我找不到描述如何在identity server 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

这些URL代表什么?

有人可以告诉我如何在Identity Server 4中设置SAML2的所有选项吗?


你解决了吗?我也遇到同样的问题。 - PinoyDev
1个回答

15

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接