问题描述
我正在使用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证书,并且元数据是直接从元数据转换器转换而来的。
'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语法检查器,但在任何一个文件中均未发现任何问题。
解决方法
刚刚发现了这个错误。事实证明,如果设置了'expire' => 1403713599,
且未更新,则会抛出“找不到元数据”错误。
通过注释expire
中的saml20-idp-remote.php
数组索引,我可以解决此问题。