Skip to content
Snippets Groups Projects
Commit 950cd11f authored by Lasse Birnbaum Jensen's avatar Lasse Birnbaum Jensen
Browse files

Documentation for attribute alter functions updated. Also described access to...

Documentation for attribute alter functions updated. Also described access to the remote Idp entity ID from alter functions.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@637 44740490-163a-0410-bde0-09ae8108e29a
parent eae7b852
No related branches found
No related tags found
No related merge requests found
...@@ -152,11 +152,13 @@ $attributemap = array( ...@@ -152,11 +152,13 @@ $attributemap = array(
with the name <literal>realm</literal>.</para> with the name <literal>realm</literal>.</para>
<para>Attribute alter functions are named by the attribute name prefixed <para>Attribute alter functions are named by the attribute name prefixed
with <code>attributealter_</code>, and are stored in the file with <code>attributealter_</code>, and are stored in a file in the
<filename>attributealter/alterfunctions.php</filename>. The attribute <filename>attributealter/</filename> directory. The filename for a given
alter function should have the name of the attribute, but prefixed with attribute alter functions must be named with the function name.
The attribute alter function should have the name of the attribute, but prefixed with
<literal>attributealter_</literal>, e.g. <literal>attributealter_realm <literal>attributealter_</literal>, e.g. <literal>attributealter_realm
for the <code>realm</code> attribute</literal>. The function signature for the <code>realm</code> attribute</literal> this function should then
be placed in <filename>attributealter/realm.php</filename>. The function signature
should be:</para> should be:</para>
<programlisting>function attributealter_realm(&amp;$attributes, $spentityid = null, $idpentityid = null) {</programlisting> <programlisting>function attributealter_realm(&amp;$attributes, $spentityid = null, $idpentityid = null) {</programlisting>
...@@ -165,7 +167,17 @@ $attributemap = array( ...@@ -165,7 +167,17 @@ $attributemap = array(
array, containing the attributes that will be sent to the service. h, array, containing the attributes that will be sent to the service. h,
and may add new attributes into this array. The function also receives and may add new attributes into this array. The function also receives
the entity IDs of the SP and the IdP.</para> the entity IDs of the SP and the IdP.</para>
<para>When doing bridging installation the IdP entity ID given to attribute
alter functions is the ID of the hosted IdP (the bridge)
and not remote IdP where the user actually came from. The correct IdP
(remote one) is found in the session object. e.g. in an alter function:</para>
<para><programlisting>...
$session = SimpleSAML_Session::getInstance();
$remoteidp = $session->getIdp();
...</programlisting></para>
<para>The attribute alter function must be declared in the metadata for <para>The attribute alter function must be declared in the metadata for
the IdP or SP metadata, similar to the 'attributemap' parameter the IdP or SP metadata, similar to the 'attributemap' parameter
discussed above: The <code>'attributealter'</code> parameter names the discussed above: The <code>'attributealter'</code> parameter names the
...@@ -183,7 +195,7 @@ $attributemap = array( ...@@ -183,7 +195,7 @@ $attributemap = array(
<para>If more than one function is defined, the parameter should be an <para>If more than one function is defined, the parameter should be an
array of names.</para> array of names.</para>
<para>Here is the complete example function:</para> <para>Here is the complete example function which must be placed in the file <filename>attributealter/realm.php</filename>:</para>
<programlisting>function attributealter_realm(&amp;$attributes, $spentityid = null, $idpentityid = null) { <programlisting>function attributealter_realm(&amp;$attributes, $spentityid = null, $idpentityid = null) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment