What I wish to accomplish is adding the following example to Authnrequest
<samlp:Extensions>
<somens:TheExtensionName xmlns:somens="http://uriofextension/">
<somens:TheExtensionName Name="AttributeName" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"
isRequired="true"/>
</somens:TheExtensionName >
</samlp:Extensions>
By using authsource.php, how am I able to accomplish that?
I've read the documentation and at the point
https://simplesamlphp.org/docs/stable/saml:sp
5.8 Using samlp:Extensions
They have:
$dom = \SAML2\DOMDocumentFactory::create();
$ce = $dom->createElementNS('http://www.example.com/XFoo', 'xfoo:test', 'Test data!');
$ext[] = new \SAML2\XML\Chunk($ce);
$auth = new \SimpleSAML\Auth\Simple('default-sp');
$auth->login(array(
'saml:Extensions' => $ext,
));
But where is this code included? As I've added it to the authsources.php without luck, and can't figure out how to use this, consider also my lack of knowledge regarding php, so maybe im just messing things.
This is what I've tried in authsources.php
Disregard some parts of the code that belong to the examples provided
<?php
$dom = \SAML2\DOMDocumentFactory::create();
$ce = $dom->createElementNS('http://www.example.com/XFoo', 'xfoo:test', 'Test data!');
$ext[] = new \SAML2\XML\Chunk($ce);
$config = array(
'sp.name' => array(
'saml:SP',
'privatekey' => '/certs/privkey.pem',
'certificate' => '/certs/fullchain.pem',
'entityID' => 'entityID',
'idp' => 'idpID',
'saml:Extensions' => $ext,
),
);