【发布时间】:2015-10-22 08:08:44
【问题描述】:
我已使用 SimpleSAMLphp 配置了 SSO 系统的标识提供程序 (IdP) 部分。
我的配置文件的主要部分:
config/config.php
$config = array(
[...]
'enable.saml20-idp' => true,
'enable.shib13-idp' => true,
[...]
);
config/authsources.php
$config = array(
[...]
'*-sql' => array(
'sqlauth:SQL',
'dsn' => 'mysql:host=*.*.*.*;port=*;dbname=*',
'username' => '*',
'password' => '*',
'query' => 'SELECT *
FROM users
WHERE username = *
AND password = *',
),
[...]
);
元数据/saml20-idp-hosted.php
$metadata['__DYNAMIC:1__'] = array(
'host' => '__DEFAULT__',
'privatekey' => '../cert/*.key',
'certificate' => '../cert/*.pem',
'auth' => '*-sql',
'NameIDFormat' => 'urn:oasis:names:tc:SAML:2.0:nameid-format:persistent',
'authproc' => array(
3 => array(
'class' => 'saml:AttributeNameID',
'attribute' => 'uid',
'Format' => 'urn:oasis:names:tc:SAML:2.0:nameid-format:persistent',
),
),
);
元数据/saml20-idp-remote.php
$metadata['https://www.video2brain.com/shibboleth'] = array(
'AssertionConsumerService' => 'http://*/Shibboleth.sso/SAML2/POST',
'SingleSignOnService' => 'http://*/Shibboleth.sso/SAML2/POST',
'SingleLogoutService' => 'http://*/Shibboleth.sso/SLO/POST',
);
证书和元数据已成功配置。 SSO 工作正常。
但服务提供商 (SP) 已要求 IdP 必须传递登录用户的更多信息。当查询返回一行时,身份验证通过,但我无法访问 SELECT 中的字段。
目前,我的 IdP 发送给其 SP 的最终 POST 请求具有以下参数:
HTTP_SHIB_IDENTITY_PROVIDER=https://*/metadata.php,
HTTP_SHIB_AUTHENTICATION_INSTANT=2015-10-20T09:04:42Z,
HTTP_SHIB_AUTHENTICATION_METHOD=urn:oasis:names:tc:SAML:2.0:ac:classes:Password,
HTTP_SHIB_AUTHNCONTEXT_CLASS=urn:oasis:names:tc:SAML:2.0:ac:classes:Password,
HTTP_EMAIL=*@*.*,
HTTP_PERSISTENT_ID=!https://*/shibboleth-sp!6faa919dda0e40e5e42088bcd9beb639ed4dfa5e
他们希望在新参数中包含用户的全名。类似的东西:
[...]
HTTP_USER_NAME=FooUserName
我曾尝试使用“添加属性(核心:AttributeAdd)”方法,但不起作用。有可能这样做吗?任何文档、资源或示例都会有所帮助。
谢谢。
【问题讨论】:
标签: php saml-2.0 simplesamlphp