【问题标题】:SimpleSAML - Could not find the metadata of an IdP with entity IDSimpleSAML - 找不到具有实体 ID 的 IdP 的元数据
【发布时间】:2021-02-24 20:11:34
【问题描述】:

我正在使用 SimpleSAMLPHP 并已成功设置 > 40 个 SSO 连接。就在最近,当用户进行身份验证时,我的一个 SSO 连接开始引发以下错误:

Backtrace:
1 www/_include.php:45 (SimpleSAML_exception_handler)
0 [builtin] (N/A)
Caused by: SimpleSAML_Error_Exception: Could not find the metadata of an IdP with entity ID 'urn:company.com:spfed:1.0:entityid:MANPROD:test'
Backtrace:
6 modules/saml/lib/Auth/Source/SP.php:134 (sspmod_saml_Auth_Source_SP::getIdPMetadata)
5 modules/saml/lib/Auth/Source/SP.php:327 (sspmod_saml_Auth_Source_SP::startSSO)
4 modules/saml/lib/Auth/Source/SP.php:430 (sspmod_saml_Auth_Source_SP::authenticate)
3 lib/SimpleSAML/Auth/Source.php:193 (SimpleSAML_Auth_Source::initLogin)
2 lib/SimpleSAML/Auth/Simple.php:147 (SimpleSAML_Auth_Simple::login)
1 modules/core/www/authenticate.php:36 (require)
0 www/module.php:135 (N/A)

我的saml20-idp-remote.php 文件如下所示:

$metadata['urn:company.com:spfed:1.0:entityid:MANPROD:test'] = array (
    'name' => [
        'en' => 'company1'
    ],
    'entityid' => 'urn:company.com:spfed:1.0:entityid:MANPROD:test',
    'description' => 
    array (
      'en' => 'Company 1',
    ),
    'OrganizationDisplayName' => 
    array (
      'en' => 'Company 1',
    ),
    'url' => 
    array (
      'en' => 'http://www.company.com/',
    ),
    'OrganizationURL' => 
    array (
      'en' => 'http://www.company.com/',
    ),
    'metadata-set' => 'saml20-idp-remote',
    'expire' => 1403713599,
    'sign.authnrequest' => true,
    'SingleSignOnService' => 
    array (
      0 => 
      array (
        'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect',
        'Location' => 'https://company.com/saml2sso',
      ),
    ),
    'SingleLogoutService' => 
    array (
    ),
    'ArtifactResolutionService' => 
    array (
    ),
    'NameIDFormats' => 
    array (
      0 => 'urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified',
    ),
    'keys' => 
    array (
      0 => 
      array (
        'encryption' => false,
        'signing' => true,
        'type' => 'X509Certificate',
        'X509Certificate' => '...',
      ),
    ),
  );

我应该注意我屏蔽了 x509 证书,并且元数据是直接从元数据转换器转换的。

我的authsources.php 文件如下所示:

'company1' => [
        'saml:SP',
        'privatekey' => 'server.pem',
        'certificate' => 'server.crt',
        'entityID' => null,
        'idp' => 'urn:company.com:spfed:1.0:entityid:MANPROD:test',
        'discoURL' => null,
],

按照说明,您可以清楚地看到我的$metadata 密钥与entityid 和authsources idp 匹配。

更奇怪的是,当我转到 IdP 列表时,company1 idp 甚至没有出现在下拉列表中,很可能是因为它找不到元数据。我想我想知道为什么它没有找到元数据?冒号和句号有问题吗?我的元数据有什么奇怪的地方吗?我运行了一个 php 语法检查器,发现这两个文件都没有问题。

【问题讨论】:

    标签: php saml saml-2.0 simplesamlphp


    【解决方案1】:

    刚刚发现错误。事实证明,如果'expire' => 1403713599, 已设置且未更新,则会抛出未找到元数据错误。

    通过注释掉saml20-idp-remote.php 中的expire 数组索引,我能够解决这个问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-08-06
      • 2019-10-07
      • 2019-09-22
      • 2019-11-03
      • 2020-10-09
      • 2018-03-18
      • 2016-12-24
      • 1970-01-01
      相关资源
      最近更新 更多