Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: inserted space(s) between keywords and "3.x" superscripts

The Static data connector allows the creation of one or more fixed attributes from a static configuration.

Schema Name and Location

This xsi:type is defined by the urn:mace:shibboleth:2.0:resolver schema, which is located at http://shibboleth.net/schema/idp/shibboleth-attribute-resolver.xsd.

Attributes

Any of the common attributes can be specified.

Child Elements

Any of the common child elements can be specified. In addition one or more <Attribute> elements can be configured.

The <Attribute> element has a required attribute, id, which specifies the name of the Attribute to generate. In addition, it must have one or more <Value> child elements. The text content of the <Value> elements provide the values for the attribute being generated.

Example

Code Block
languagexml
titleExample of a Static DataConnector
<DataConnector id="staticAttributes" xsi:type="Static">
	<Attribute id="eduPersonAffiliation">
		<Value>member</Value>
	</Attribute>
	<Attribute id="eduPersonEntitlement">
		<Value>https://example.org/entitlement/entitlement1</Value>
		<Value>urn:mace:dir:entitlement:common-lib-terms</Value>
	</Attribute>
</DataConnector>

Spring Configuration 3.1

The Static Data Connector can be configured using the springResources or springResourcesRef attributes.

Code Block
languagexml
titleExample Spring configuration : conf/attribute-resolver.xml
collapsetrue
<DataConnector id="staticAttributesSpring" xsi:type="Static"
                        springResources="${idp.home}/conf/staticAttributesSpring.xml"/> 

The Spring Resource should provide a bean of type Collection consisting of IdPAttribute elements populated with .

Code Block
languagexml
titleExample Spring configuration : conf/staticAttributesSpring.xml
collapsetrue
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:util="http://www.springframework.org/schema/util"
    xmlns:p="http://www.springframework.org/schema/p"
    xmlns:c="http://www.springframework.org/schema/c"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
                        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
                        http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"
    default-init-method="initialize" default-destroy-method="destroy">

    <util:list id="values">
        <bean class="net.shibboleth.idp.attribute.IdPAttribute" c:attributeId="exampleAttributeId1">
            <property name="values">
                <list>
                    <bean class="net.shibboleth.idp.attribute.StringAttributeValue" c:attributeValue="exampleAttributeValue1" />
                    <bean class="net.shibboleth.idp.attribute.StringAttributeValue" c:attributeValue="exampleAttributeValue2" />
                </list>
            </property>
        </bean>
        <bean class="net.shibboleth.idp.attribute.IdPAttribute" c:attributeId="exampleAttributeId2">
            <property name="values">
                <list>
                    <bean class="net.shibboleth.idp.attribute.StringAttributeValue" c:attributeValue="exampleAttributeValue3" />
                </list>
            </property>
        </bean>
    </util:list>
 
</beans>