Improve example configs
[java-idp.git] / resources / conf / attribute-resolver.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <AttributeResolver xmlns="urn:mace:shibboleth:2.0:resolver"
4                    xmlns:resolver="urn:mace:shibboleth:2.0:resolver"
5                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6                    xmlns:pc="urn:mace:shibboleth:2.0:resolver:pc"
7                    xmlns:ad="urn:mace:shibboleth:2.0:resolver:ad"
8                        xmlns:dc="urn:mace:shibboleth:2.0:resolver:dc"
9                    xmlns:enc="urn:mace:shibboleth:2.0:attribute:encoder"
10                        xsi:schemaLocation="urn:mace:shibboleth:2.0:resolver classpath:/schema/shibboleth-2.0-attribute-resolver.xsd
11                                        urn:mace:shibboleth:2.0:resolver:pc classpath:/schema/shibboleth-2.0-attribute-resolver-pc.xsd
12                                        urn:mace:shibboleth:2.0:resolver:ad classpath:/schema/shibboleth-2.0-attribute-resolver-ad.xsd
13                                        urn:mace:shibboleth:2.0:resolver:dc classpath:/schema/shibboleth-2.0-attribute-resolver-dc.xsd
14                                        urn:mace:shibboleth:2.0:attribute:encoder classpath:/schema/shibboleth-2.0-attribute-encoder.xsd">
15
16     <!-- ========================================== -->
17     <!--      Attribute Definitions                 -->
18     <!-- ========================================== -->
19     
20     <!-- Example attribute defintions -->
21     <!--
22     <resolver:AttributeDefinition id="uid" xsi:type="ad:Simple">
23         <resolver:DataConnectorDependency ref="myLDAP" />
24     </resolver:AttributeDefinition>
25     -->
26     
27     <!--
28     <resolver:AttributeDefinition id="scopedPrimaryAffiliation" xsi:type="ad:Scoped">
29         <resolver:DataConnectorDependency ref="staticAttributes" sourceAttributeID="staticEPPA" />
30         <resolver:DataConnectorDependency ref="myLDAP" sourceAttribute="eduPersonPrimaryAffiliation" />
31         
32         <resolver:AttributeEncoder xsi:type="SAML1ScopedString"
33                                    name="urn:mace:dir:attribute-def:eduPersonScopedAffiliation"/>
34         
35         <resolver:AttributeEncoder xsi:type="SAML2ScopedString"
36                                    name="urn:mace:dir:attribute-def:eduPersonScopedAffiliation"/>
37                                    
38         <resolver:AttributeEncoder xsi:type="SAML2StringNameID" />
39         
40         </resolver:AttributeEncoder>
41     </resolver:AttributeDefinition>
42     -->
43     
44     <!--
45     <resolver:AttributeDefinition id="affiliation" xsi:type="ad:Simple">
46         <resolver:DataConnectorDependency ref="myLDAP" sourceAttribute="eduPersonAffiliation" />
47         
48         <resolver:AttributeEncoder xsi:type="SAML1String"
49                                    name="urn:mace:dir:attribute-def:eduPersondAffiliation"/>
50         
51         <resolver:AttributeEncoder xsi:type="SAML2String"
52                                    name="urn:oid:1.3.6.1.4.1.5923.1.1.1.1"
53                                    friendlyName="eduPersonAffiliation"/>
54     </resolver:AttributeDefinition>
55     -->
56     
57     <!--
58     <resolver:AttributeDefinition id="fullName" xsi:type="Script">
59         <resolver:DataConnectorDependency ref="myLDAP" sourceAttribute="eduPersonAffiliation" />
60         
61         <Script>
62             <![CDATA[
63                 importPackage(Packages.edu.internet2.middleware.shibboleth.common.attribute.provider);
64                 fullname = new BasicAttribute("fullname");
65                 fullname.getValues().add(givenName.getValues().first() + " " + sn.getValues().first());
66             ]]>
67         </Script>
68     </resolver:AttributeDefinition>
69     -->
70     
71     
72     <!-- ========================================== -->
73     <!--      Data Connectors                       -->
74     <!-- ========================================== -->
75     
76     <!-- Example Static Connector -->
77     <!--
78     <resolver:DataConnector id="staticAttributes" xsi:type="dc:Static">
79         <dc:Attribute id="staticEPPA">
80             <dc:Value>member</dc:Value>
81         </dc:Attribute>
82         <dc:Attribute id="staticEPE">
83             <dc:Value>urn:example.org:entitlement:entitlement1</dc:Value>
84             <dc:Value>urn:mace:dir:entitlement:common-lib-terms</dc:Value>
85         </dc:Attribute>
86     </resolver:DataConnector>
87     -->
88     
89     <!-- Example Relational Database Connector -->
90     <!--
91     <resolver:DataConnector id="mySIS" xsi:type="dc:RelationalDatabase">
92         <dc:ApplicationManagedConnection jdbcDriver="oracle.jdbc.driver.OracleDriver"
93                                          jdbcUrl="jdbc:oracle:thin:@db.example.org:1521:SomeDB"
94                                          jdbcUserName="myid"
95                                          jdbcPassword="mypassword" />
96         <dc:QueryTemplate>
97             <![CDATA[
98                  SELECT * FROM student WHERE gzbtpid = ${principal}
99              ]]>
100         </dc:QueryTemplate>
101     
102         <dc:Column columnName="gzbtpid" attributeID="uid"/>
103         <dc:Column columnName="fqlft" attributeID="gpa" type="Float"/>
104     </resolver:DataConnector>
105     -->
106     
107     <!-- Example LDAP Connector -->
108     <!--
109     <resolver:DataConnector id="myLDAP" xsi:type="LDAPDirectory"
110                             ldapUrl="ldap://ldap.example.org"
111                             baseDN="ou=people,dc=example,dc=org"
112                             principal="uid=myservice,ou=system"
113                             principalCredential="myServicePassword">
114         <dc:FilterTemplate>
115             <![CDATA[
116                 (uid=${principal})
117             ]]>
118         </dc:FilterTemplate>
119     
120     </resolver:DataConnector>
121     -->
122     
123     <!-- ========================================== -->
124     <!--      Principal Connectors                  -->
125     <!-- ========================================== -->
126     <resolver:PrincipalConnector xsi:type="pc:Direct" 
127                                  id="directPC"
128                                  nameIDFormat="urn:oasis:names:tc:SAML:1.0:nameid-format:unspecified" />
129
130 </AttributeResolver>