Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
xml
xml
titleBasic Template Attribute Definition

<resolver:AttributeDefinition xsi:type="Template" xmlns="urn:mace:shibboleth:2.0:resolver:ad"
                              id="UNIQUE_ID">

     <!-- Remaining configuration from the next step go here -->

</resolver:AttributeDefinition>

...

Code Block
xml
xml
titleBasic Template Attribute Definition

<resolver:AttributeDefinition xsi:type="Template" xmlns="urn:mace:shibboleth:2.0:resolver:ad"
                              id="eduCourseOffering">

     <resolver:Dependency ref="myDatabase" />

     <Template>
          <![CDATA[
               http://example.edu/courses/${academic_term}/${course_id}/${course_section}
          ]]>
     </Template>

     <SourceAttribute>academic_term</SourceAttribute>
     <SourceAttribute>course_id</SourceAttribute>
     <SourceAttribute>course_section</SourceAttribute>

</resolver:AttributeDefinition>

4. Define an encoding method

For the attribute to be passed on, an encoding needs to be defined that wraps the attribute defined in the template. Note that the encoding declaration cannot simply re-use the id used in the attribute definition. As an example, we could construct an email address from the LDAP uid (when email address is not in the LDAP directory)

Code Block
xmlxml
titleBasic Attribute encoding declaration

<resolver:AttributeDefinition xsi:type="Template" xmlns="urn:mace:shibboleth:2.0:resolver:ad" id="mailtemp">
    <resolver:Dependency ref="myLDAP" />
    <Template>
        <![CDATA[
             ${uid}@podunk.edu
        ]]>
    </Template>

    <SourceAttribute>uid</SourceAttribute>
</resolver:AttributeDefinition>

<resolver:AttributeDefinition id="mail" xsi:type="Simple" xmlns="urn:mace:shibboleth:2.0:resolver:ad"
                              sourceAttributeID="mailtemp">
    <resolver:Dependency ref="mailtemp" />
    <resolver:AttributeEncoder xsi:type="SAML1String" xmlns="urn:mace:shibboleth:2.0:attribute:encoder"
                               name="urn:mace:dir:attribute-def:mail" />
  

<resolver:AttributeEncoder xsi:type="SAML2String" xmlns="urn:mace:shibboleth:2.0:attribute:encoder"
                               name="urn:oid:0.9.2342.19200300.100.1.3" friendlyName="mail" />
</resolver:AttributeDefinition>