我尝试在本地安装一个SP和一个IDP,所以我创建了另一个主机:
127.0.0.1 localhost
::1 localhost
127.0.0.1 auth.saml.net 我创建了两个虚拟主机(一个用于SP,另一个用于Idp)
<VirtualHost auth.saml.net:80>
ServerAdmin toto@gmail.com
ServerName auth.saml.net
AddDefaultCharset UTF-8
Alias /simplesaml c:/wamp/www/var2/simplesamlphp/www/
<Directory c:/wamp/www/var2/simplesamlphp/www/ >
Order Deny,Allow
Allow from all
</Directory>
</VirtualHost>
<VirtualHost localhost:80>
ServerAdmin toto@gmail.com
ServerName localhost
AddDefaultCharset UTF-8
Alias /simplesaml c:/wamp/www/var/simplesamlphp/www/
</VirtualHost>(文件夹var2是为我的IDP和文件夹var为我的SP,它不是真的干净,但实际上,我只是想让它工作)
在第二,我通过编辑每个文件夹中的config/config.php文件来配置我的SP和idp (我不忘将enable.saml20-idp放在IDP的true )
接下来,我从我的idp中编辑了config/authSoures.php文件,我有两个假用户:
'example-userpass' => array(
'exampleauth:UserPass',
'user1:pwd' => array(
'uid' => array('user1'),
'mail' => 'user1@test.com',
'first_name' => 'User',
'last_name' => 'One'
),
'user2:pwd' => array(
'uid' => array('user2'),
'mail' => 'user2@test.com',
'first_name' => 'User',
'last_name' => 'Two'
)
)我还在我的SP部件上编辑了config/authSoures.php文件:
'default-sp' => array(
'saml:SP',
'entityID' => 'auth.saml.net',
'idp' => 'auth.saml.net/simplesaml/saml2/idp/metadata.php',
'ssoPortalUrl'=> 'auth.saml.net/simplesaml/saml2/idp/SSOService.php',
'discoURL' => null
);接下来,我将这些元数据从我的IDP (联邦->打印元数据-> SimpleSAMLphp平面文件格式)复制到我的文件“MetadataSaml20-IDP-遥控器”中的SP中:
$metadata['auth.saml.net/simplesaml/saml2/idp/metadata.php'] = array (
'metadata-set' => 'saml20-idp-remote',
'entityid' => 'auth.saml.net/simplesaml/saml2/idp/metadata.php',
'SingleSignOnService' =>
array (
0 =>
array (
'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect',
'Location' => 'auth.saml.net/simplesaml/saml2/idp/SSOService.php',
),
),
'SingleLogoutService' =>
array (
0 =>
array (
'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect',
'Location' => 'auth.saml.net/simplesaml/saml2/idp/SingleLogoutService.php',
),
),
'certData' => 'certData',
'NameIDFormat' => 'urn:oasis:names:tc:SAML:2.0:nameid-format:transient',
);以及我的SP到我的IDP的元数据,在‘Metadata.saml20-sp-emote.php’文件中:
$metadata['auth.saml.net'] = array (
'SingleLogoutService' =>
array (
0 =>
array (
'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect',
'Location' => 'http://localhost/simplesaml/module.php/saml/sp/saml2-logout.php/default-sp',
),
),
'AssertionConsumerService' =>
array (
0 =>
array (
'index' => 0,
'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST',
'Location' => 'http://localhost/simplesaml/module.php/saml/sp/saml2-acs.php/default-sp',
),
1 =>
array (
'index' => 1,
'Binding' => 'urn:oasis:names:tc:SAML:1.0:profiles:browser-post',
'Location' => 'http://localhost/simplesaml/module.php/saml/sp/saml1-acs.php/default-sp',
),
2 =>
array (
'index' => 2,
'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact',
'Location' => 'http://localhost/simplesaml/module.php/saml/sp/saml2-acs.php/default-sp',
),
3 =>
array (
'index' => 3,
'Binding' => 'urn:oasis:names:tc:SAML:1.0:profiles:artifact-01',
'Location' => 'http://localhost/simplesaml/module.php/saml/sp/saml1-acs.php/default-sp/artifact',
),
),
);但是,当我试图通过单击“测试配置的身份验证源”进行测试时,我会收到以下错误消息:
Exception during login:
SimpleSAML_Error_Exception: Could not find the metadata of an IdP with entity ID 'auth.saml.net/simplesaml/saml2/idp/metadata.php'
Backtrace:
6 C:\wamp\www\var\simplesamlphp\modules\saml\lib\Auth\Source\SP.php:134 (sspmod_saml_Auth_Source_SP::getIdPMetadata)
5 C:\wamp\www\var\simplesamlphp\modules\saml\lib\Auth\Source\SP.php:308 (sspmod_saml_Auth_Source_SP::startSSO)
4 C:\wamp\www\var\simplesamlphp\modules\saml\lib\Auth\Source\SP.php:390 (sspmod_saml_Auth_Source_SP::authenticate)
3 C:\wamp\www\var\simplesamlphp\lib\SimpleSAML\Auth\Default.php:65 (SimpleSAML_Auth_Default::initLogin)
2 C:\wamp\www\var\simplesamlphp\lib\SimpleSAML\Auth\Simple.php:136 (SimpleSAML_Auth_Simple::login)
1 C:\wamp\www\var\simplesamlphp\modules\core\www\authenticate.php:45 (require)
0 C:\wamp\www\var\simplesamlphp\www\module.php:134 (N/A)我已经尝试从一开始就重新构建配置,但是错误仍然存在。当我转到链接'auth.saml.net/simplesaml/saml2/idp/metadata.php‘时,元数据打印得很好。
发布于 2015-06-01 13:59:17
我犯了几个错误:
发布于 2015-05-31 13:29:03
用于SP的config/authsources.php es.php应该可以做到。
‘’default SP‘=>数组( 'saml:SP','idp’=> =>
);
https://stackoverflow.com/questions/30511003
复制相似问题