添加自定义属性SimpleSAMLPhp
问题描述:
我使用这个页面作为参考指南:core:PHP添加自定义属性SimpleSAMLPhp
它的内容适用于已经在我的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'),
.........
请问雇员和securityKey属性自动传递给SP这样?
编辑:
我能够运行一个测试,我得到从属性用户名不存在SP的错误。我做错了什么?
答
为此,您最好使用core:AttributeMap和core:AttributeAdd。核心的使用:由于PHP推荐against这些类型的结构,通常不建议使用PHP模块。如果您确实需要某些不包含AuthProc过滤器的产品,请考虑编写自己的过滤器。
不知何故,我从来没有看到AttributeAdd直到你发布它。谢谢! –