2

I am new to SimpleSamlPhp, I already setup a working environment, it is able to redirect to an URL @ metadata\saml20-sp-remote.php

Example:

$metadata['http://www.example.com'] = array(
    'AssertionConsumerService' => 'http://www.example.com/acceptsaml.php',
    'SingleLogoutService' => 'http://www.example.com/saml2-logout.php',
);

How to pass extra custom fields (I added new custom fields, example: EmployeeID, in auth_user table) as XML/Json after authentication redirect?

Thanks.

Jack
  • 377
  • 5
  • 19

1 Answers1

0

You can use authProc filters to add new attributes to the XML asserted by your IdP. The auth source you use may also have additional options for adding/naming attributes.

$metadata['myEntityId'] = array(
        'host' => 'my-hostname',
        'privatekey' => 'key.pem',
        'certificate' => 'pub.crt',
        'auth' => 'auth-source',
        'signature.algorithm' => 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256',
        'attributes.NameFormat' => 'urn:oasis:names:tc:SAML:2.0:attrname-format:uri',
        'authproc' => array(
            50 => array(
               'class' => 'core:AttributeAdd',
               'myAttribute' => array('some-value'),
            ),
         ),
);
Patrick
  • 3,901
  • 1
  • 25
  • 30