Appending text to user's account after IdP authentication / before SP redirect

你离开我真会死。 提交于 2019-12-10 18:04:49

问题


I need to append the email domain (@domain.com) to a user's account after they are IdP validated, and before the system redirects them to the SP.

I am using this page for assistance but am unable to assert whether I will type in the additional text literally, or by referencing another attribute retrieved from LDAP: http://simplesamlphp.org/docs/stable/simplesamlphp-authproc


回答1:


You must apply the filter at the metadata/saml20-idp-hosted.php

Use a 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
        ',
    ),
 ),

This filter for example create a 'mail' attribute based on an 'uid' attribute. Note that attribute values at the $attributes are always an array.



来源:https://stackoverflow.com/questions/14043820/appending-text-to-users-account-after-idp-authentication-before-sp-redirect

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!