2012-12-26 46 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