StaticDataConnector

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 3.3, located at http://shibboleth.net/schema/idp/shibboleth-attribute-resolver.xsd.

Prior to V3.3 supplied plugins were defined by a schema type (xsi:type) in the urn:mace:shibboleth:2.0:resolver:dc namespace, the schema for which is located at http://shibboleth.net/schema/idp/shibboleth-attribute-resolver-dc.xsd. This is still supported, but every element or type in the  urn:mace:shibboleth:2.0:resolver:dc namespace has an equivalently named (but not necessarily identical) version in the urn:mace:shibboleth:2.0:resolver namespace. The use of the urn:mace:shibboleth:2.0:resolver namespace also allows a relaxation of the ordering requirements of child elements to reduce strictness.

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

Example 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.

Example Spring configuration : conf/attribute-resolver.xml
<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 IdPAttributeValues

Example Spring configuration : conf/staticAttributesSpring.xml
<?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>