使用 drupal 和 simplesamlphp_auth“找不到 IdP 的元数据”

bin*_*ork 5 authentication drupal saml simplesamlphp

我使用 Drupal 设置了 SimpleSamlPhp(我的 IdP 在另一台服务器上)。以管理员身份登录“ http://localhost:31478/simplesaml/ ”后,我使用 IdP 运行“测试身份验证源”,显示了具有正确属性的“SAML 2.0 SP 演示示例”屏幕。我猜这意味着 SimpleSamlPhp 和我的 Idp 可以看到对方并进行正确通信。

但是,当我在打开“通过 SimpleSAMLphp 激活身份验证”后尝试使用 Drupal 进行联合登录时,出现以下错误:

SimpleSAML_Error_Exception: Could not find the metadata of an IdP with entity ID 'tenant2.test.com' in sspmod_saml_Auth_Source_SP->getIdPMetadata() (line 134 of /var/www/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Source/SP.php).

设置

  • Drupal版本是8。
  • PHP版本是5.6.24-0。
  • simplesamlphp_auth 模块版本是 8.x-3.0-alpha4+2-dev。
  • simplesamlphp_auth 模块已在 Drupal 中安装并启用。simplesamlphp_auth 模块配置的“此 SP 的身份验证源”设置为“default-sp”

我的 simplesamlphp 目录位于 /var 中。为了启用 saml 进行了以下更改

/var/simplesamlphp/config/config.php


    'baseurlpath' => 'simplesaml/',
    ....
    'enable.saml20-sp'  => true,
    'enable.saml20-idp' => true,
    'enable.shib13-idp' => false,
    'enable.adfs-idp' => false,
    'enable.wsfed-sp' => false,
    'enable.authmemcookie' => false,
    ....
    'saml' => TRUE,
    ....
    ....
    'default-saml20-idp' => 'tenant2.test.com',
    ....
    'store.type'                    => 'memcache',
    ....
    ....
    'memcache_store.servers' => array(
        array(
            array('hostname' => 'localhost'),
        ),
    ),
    'memcache_store.prefix' => 'SimpleSAMLphp',
    ....
    .... 
    'trusted.url.domains' => array('localhost:31478'),
Run Code Online (Sandbox Code Playgroud)

/var/simplesamlphp/config/authsources.php


    <?php
    $config = array(
        'admin' => array(
        'core:AdminPassword',
        ),

        'default-sp' => array(
            'saml:SP',
        'privatekey' => 'saml.pem',
        'certificate' => 'saml.crt',       
        'entityID' => null,
        'idp' => 'tenant2.test.com',  
        'discoURL' => null,
    ),

    );
    
Run Code Online (Sandbox Code Playgroud)

/var/simplesamlphp/metadata/saml20-idp-remote.php


    <?php
        $metadata['tenant2.test.com'] = array(
            'SingleSignOnService'  => 'https://tenant2.test.com/testSamlLogin',
            'AssertionConsumerService' => 'http://localhost:31478/simplesaml/module.php/saml/sp/saml2-acs.php/default-sp',
            'SingleLogoutService'  => 'https://tenant2.test.com/admin/logout',
            'certFingerprint'      => '0a89aec59bf48e414ec050f6956891cb3f5b09a0',
        );
Run Code Online (Sandbox Code Playgroud)

几天来我一直在尝试解决这个问题。我错过了什么吗?

谢谢。

Ran*_*jan 0

您是否尝试将tenant2.test.com“entityID”替换为 null?