2
我需要在电子邮件域(@ domain.com)经过IdP验证并在系统重定向到SP之前将其附加到用户的帐户。在IdP认证/ SP重定向之前向用户帐户追加文本
我使用此页面帮助,但我无法断言是否我将在其他文本字符键入,或通过引用从LDAP检索到的另一个属性:http://simplesamlphp.org/docs/stable/simplesamlphp-authproc
我需要在电子邮件域(@ domain.com)经过IdP验证并在系统重定向到SP之前将其附加到用户的帐户。在IdP认证/ SP重定向之前向用户帐户追加文本
我使用此页面帮助,但我无法断言是否我将在其他文本字符键入,或通过引用从LDAP检索到的另一个属性:http://simplesamlphp.org/docs/stable/simplesamlphp-authproc
您必须在元数据应用过滤器/ saml20 -idp-hosted.php
使用PHP filter:
'authproc.idp' => array(
60 => array(
'class' => 'core:PHP',
'code' => '
if (!empty($attributes["uid"])) {
$mail = $attributes["uid"][0] . "@domain.com";
$attributes["mail"] = array($mail);
} //Closing bracket was missing
',
),
),
这个过滤器,例如创建一个 '邮件' 属性基于一个为 'uid' 属性。 请注意,$属性处的属性值始终是一个数组。
这也可以在config.php中工作,是吗? –
是的,如果你把它放在config.php中,过滤器将应用于在metadata/saml20-idp-hosted.php和config/authsources.php上定义的所有SP上定义的IdP 引用:http:///simplesamlphp.org/docs/stable/simplesamlphp-authproc?#section_1 – smartin