ResolverRDBMSDataConnector
Relational Database Data Connector
The relational database data connector pulls attribute information from any JDBC capable relational database. The following steps walk through how to set up this connector.
1. Define the Connector
To define a new relational database data connector, create a <DataConnector xsi:type="RelationalDatabase" xmlns="urn:mace:shibboleth:2.0:resolver:dc">
with the following attribute:
- id - A unique ID for this data connector used within the resolver configuration
The following advanced options may also be defined as attributes on the <resolver:DataConnector>
element.
- readOnlyConnection- a boolean flag that determines whether connections to the database should be read-only; defaults to true
- queryUsesStoredProcedure - a boolean flag that indicates whether the SQL query, defined in step 3, uses stored procedures or not; defaults to false
- cacheResults - a boolean flag that indicates whether search results should be cached for the lifetime of a user's session; defaults to false, deprecated in favor of the
<ResultCache>
element (see below) - noResultIsError - a boolean flat that indicates whether a query that returns no results should be treated as an error; defaults to false
- queryTimeout - timeout in milliseconds of the SQL query; defaults to 5000
<resolver:DataConnector xsi:type="RelationalDatabase" xmlns="urn:mace:shibboleth:2.0:resolver:dc" id="UNIQUE_ID"> <!-- Remaining configuration from the next steps goes here --> </resolver:DataConnector>
Note to PostgreSQL users
You have to set the "queryTimeout" attribute to "0". This feature is not yet supported by the PostgreSQL JDBC driver and the default value will cause a crash when starting the IdP.
2. Define Dependencies
This step is optional.
One component within the attribute resolver, like data connectors, can depend on information retrieved or constructed by another component. The values from these dependencies may then be used within the query template in the next step. This might be useful if your SQL query depended on the value retrieved from another connector. For example, if you wanted to use an employeeID
retrieved from one source to get attributes from another, a dependency on that attribute would allow it to be used as a variable in the SQL query.
Dependencies are expressed by the <resolver:Dependency>
with a ref
attribute whose value is the unique ID of the attribute definition or the data connector that this connector depends on.
<resolver:DataConnector xsi:type="RelationalDatabase" xmlns="urn:mace:shibboleth:2.0:resolver:dc" id="UNIQUE_ID"> <resolver:Dependency ref="DEFINITION_ID_1" /> <resolver:Dependency ref="DEFINITION_ID_2" /> <resolver:Dependency ref="CONNECTOR_ID_3" /> <resolver:Dependency ref="CONNECTOR_ID_4" /> <!-- Remaining configuration from the next steps go here --> </resolver:DataConnector>
3. Define Failover Data Connectors
This step is optional.
If the data connector encounters an error when trying to retrieve attribute information from the database, one or more failover data connectors can be defined. These connectors are only invoked if this data connector fails (not if simply finds no results) and they are invoked in the order they are listed until one succeeds.
Failover connectors are defined by the <resolver:FailoverDataConnector>
element with a ref
attribute whose value is the unique ID of the data connector to use in the event that this one fails.
<resolver:DataConnector xsi:type="dc:RelationalDatabase" xmlns="urn:mace:shibboleth:2.0:resolver:dc" id="UNIQUE_ID"> <resolver:Dependency ref="DEFINITION_ID_1" /> <resolver:Dependency ref=&qu