You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

基于SAML2协议实现IdentityServer4与SuiteCRM的SSO集成

IdentityServer4与SuiteCRM SSO集成(SAML2支持)解决方案

1. 免费开源SAML2支持包

IdentityServer4侧

IdentityServer4本身不内置SAML2协议支持,但可通过ITfoxtec.IdentityServer4.Saml2免费开源扩展包,让它成为SAML2身份提供商(IdP)。该包完全兼容现有OIDC配置,无需改动原有OIDC客户端逻辑。

配置示例(ASP.NET Core Startup):

using ITfoxtec.IdentityServer4.Saml2;

public void ConfigureServices(IServiceCollection services)
{
    services.AddIdentityServer()
        // 保留原有OIDC相关配置(AddInMemoryClients、AddInMemoryIdentityResources等)
        .AddSaml2Idp(options =>
        {
            options.EntityId = "https://your-idsrv-domain/saml2";
            // 可复用OIDC的签名证书
            options.SigningCertificate = new X509Certificate2("idsrv-signing-cert.pfx", "cert-password");
        })
        // 添加SuiteCRM作为SAML2服务提供商(SP)客户端
        .AddInMemorySaml2Clients(new List<Saml2Client>
        {
            new Saml2Client
            {
                ClientId = "suitecrm-sp",
                EntityId = "https://your-suitecrm-domain/saml/metadata",
                AssertionConsumerServiceUrl = "https://your-suitecrm-domain/saml/acs",
                // 若SuiteCRM要求签名断言,配置其公钥证书
                SigningCertificate = new X509Certificate2("suitecrm-sp-cert.pem")
            }
        });
}

public void Configure(IApplicationBuilder app)
{
    app.UseIdentityServer();
    // 启用SAML2端点
    app.UseSaml2Idp();
}

SuiteCRM侧

SuiteCRM需安装社区维护的开源SAML2 Authentication模块(免费),使其成为SAML2服务提供商(SP)。安装后通过后台配置对接IdentityServer4:

  • 进入Admin面板,找到SAML2 Settings
  • 填入IdentityServer4的SAML2元数据地址:https://your-idsrv-domain/saml2/metadata
  • 配置SuiteCRM自身的SP实体ID、断言消费服务(ACS)地址(模块通常自动生成,也可手动指定)
  • 启用SAML2作为登录方式,可选禁用原有密码登录

2. OIDC与SAML2协议互转的免费适配器

若不想直接修改IdentityServer4配置,可使用SimpleSAMLphp免费开源身份代理工具实现协议转换:

  • 将SimpleSAMLphp部署为中间层,配置它作为OIDC客户端对接你的IdentityServer4
  • 同时将SimpleSAMLphp配置为SAML2 IdP,让SuiteCRM对接该SAML2服务
  • 此方式下,IdentityServer4保持原有OIDC配置不变,所有SAML2请求由SimpleSAMLphp转换为OIDC请求转发给IdP

核心配置逻辑:

  1. 在SimpleSAMLphp中启用oidc模块,配置IdentityServer4为OIDC提供商
  2. 启用saml模块,配置SimpleSAMLphp作为SAML2 IdP
  3. SuiteCRM配置SimpleSAMLphp的SAML2元数据地址作为IdP来源

内容的提问来源于stack exchange,提问作者Bassam

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.07 22:30:20