2012-12-26 44 views

回答

1

您必须在元数据应用过滤器/ 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' 属性。 请注意,$属性处的属性值始终是一个数组。

+0

这也可以在config.php中工作,是吗? –

+0

是的,如果你把它放在config.php中,过滤器将应用于在metadata/saml20-idp-hosted.php和config/authsources.php上定义的所有SP上定义的IdP 引用:http:///simplesamlphp.org/docs/stable/simplesamlphp-authproc?#section_1 – smartin