phpsamlsimplesamlphp

How to change NameID in SimpleSAMLphp


I'm developing a SSO using simpleSAMLphp.

I configured correctly the service provider and the IdP, but I have to send the XML to the SP with a NameID in a specific format.

How can I perform this? In the metadata? or can I do it through the code?

Thanks,


Solution

  • I sorted already, I post the solution below:

    In the IdP authsources config file:

    'idp-name' => array(
    ...
    'message' => 'key1:'.$value1.';key2:'.$value2,
    ...
    ),
    

    And in the metadata of the Service Provider (saml20-sp-remote.php):

    ...
    'NameIDFormat' => 'urn:oasis:names:tc:SAML:1.1:nameid-format:persistent',
    'simplesaml.nameidattribute' => 'message',
    ...
    

    Then in your code you only have to specify $value1 and $value2 before doing the authentication.

    Thanks to Anthony for the help.