我将此页面用作参考指南:core:PHP
它读为适用于LDAP中已经存在的属性,但是如果我想完全添加一个新属性怎么办?
我添加了以下两个新内容;第一个被重命名为新的东西,第二个是静态的:
saml20-idp-hosted.php
_____________________
100 => array(
'class' => 'core:PHP',
'code' => '
if (!empty($attributes["blahblahID"])) {
$employeeID = $attributes["blahblahID"][0];
$attributes["employeeID"] = array($employeeID);
}
$attributes["securityKey"] = array("123456");
if (!empty($attributes["displayname"])) {
$displayname = $attributes["displayname"][0];
$attributes["UserName"] = array($displayname);
}
',
),
saml20-sp-remote.php
____________________
$metadata['Corestream'] = array(
'metadata-set' => 'saml20-sp-remote',
'simplesaml.attributes' => true,
'attributes' => array('UserName','employeeID','securityKey'),
.........
员工ID和securityKey属性是否将以这种方式自动传递到SP?
编辑:
我能够运行测试,并且从SP中收到错误,提示用户名UserName不存在。我做错了什么?
为此,最好使用core:AttributeMap和core:AttributeAdd。通常不建议使用core:PHP模块,因为PHP建议不要使用此类构造。如果您确实需要包含的AuthProc过滤器无法提供的功能,请考虑编写自己的过滤器。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句