First stab at an example config file.
[java-idp.git] / src / conf / resolver.jdbc.xml
1 <AttributeResolver xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:mace:shibboleth:resolver:1.0" xsi:schemaLocation="urn:mace:shibboleth:resolver:1.0 shibboleth-resolver-1.0.xsd">
2         
3         <!-- Simple example JDBC Connector setup with a query based on principal name -->
4         
5         <SimpleAttributeDefinition id="urn:mace:dir:attribute-def:eduPersonEntitlement" sourceName="entitlement">
6                 <DataConnectorDependency requires="db1"/>
7         </SimpleAttributeDefinition>
8
9         <JDBCDataConnector id="db1" 
10                 dbURL="jdbc:postgresql://test.example.edu/test?user=postgres&amp;password=test" 
11                 dbDriver="org.postgresql.Driver"
12                 maxActive="10"
13                 maxIdle="5">
14                 <Query>select entitlement from foo where name = ?</Query>
15         </JDBCDataConnector>
16
17
18
19
20         <!-- A more complicated example, where a query is constructed based on dependencies
21                 on another Data Connector and an Attribute Definition -->
22                 
23         <SimpleAttributeDefinition id="urn:mace:dir:attribute-def:eduPersonAffiliation">
24                 <DataConnectorDependency requires="echo"/>
25         </SimpleAttributeDefinition>
26
27         <SimpleAttributeDefinition id="urn:x-mace:shibboleth:date">
28                 <DataConnectorDependency requires="db2"/>
29         </SimpleAttributeDefinition>
30         
31         <JDBCDataConnector id="db2" 
32                 dbURL="jdbc:postgresql://test.example.edu/test?user=postgres&amp;password=test" 
33                 dbDriver="org.postgresql.Driver"
34                 maxActive="10" 
35                 maxIdle="5">
36                 <DataConnectorDependency requires="echo"/>
37                 <AttributeDependency requires="urn:mace:dir:attribute-def:eduPersonEntitlement"/>
38                 <Query>select date from foo where principalName = ? and entitlement = ?</Query>
39                 <StatementCreator class="edu.internet2.middleware.shibboleth.aa.attrresolv.provider.DependencyStatementCreator">
40                         <Parameter type="String" attributeName="eduPersonPrincipalName" connectorId="echo" nullMissing="false"></Parameter>
41                         <Parameter type="String" attributeName="urn:mace:dir:attribute-def:eduPersonEntitlement" nullMissing="false"></Parameter>
42                 </StatementCreator>
43         </JDBCDataConnector>
44         
45         <CustomDataConnector id="echo" class="edu.internet2.middleware.shibboleth.aa.attrresolv.provider.SampleConnector"/>
46         
47 </AttributeResolver>