Stored ID Data Connector

This connector creates and persists unique identifiers. The first ID created for a given requester is always the same as those created by the computed ID data connector in order to provide a migration path from that data connector. Every subsequently generated ID for a given user/IdP/SP triple, if the first one is revoked, is a Type 4 UUID.

The IDs are created by this data connector are usually used as user identifiers because of their properties:

1. Define the Database

The Stored ID data connector stores its created ID in a database. You must create a database with the following definition. Note this definition is database independent and may need additional information depending on the database you use. Examples for common database systems are available.

CREATE TABLE shibpid (
    localEntity VARCHAR NOT NULL,
    peerEntity VARCHAR NOT NULL,
    principalName VARCHAR NOT NULL,
    localId VARCHAR NOT NULL,
    persistentId VARCHAR NOT NULL,
    peerProvidedId VARCHAR NULL,
    creationDate TIMESTAMP NOT NULL,
    deactivationDate TIMESTAMP NULL
)

You should also create indexes on the following sets of fields:

Ensure that the collation associated with the localId field is appropriate for use with the sourceAttributeID you will specify below. An inappropriate collation could render the attribute non-unique.
In particular, it has been observed that a case-sensitive collation is needed if using the Active Directory objectSid as the source attribute, to ensure that persistent IDs are uniquely identified.
utf8_bin has been found to work in this circumstance.

2. Define the Connector

To define a new computed ID data connector, create a <DataConnector xsi:type="dc:StoredId" xmlns="urn:mace:shibboleth:2.0:resolver:dc"> element with the following attributes:

3. Define Dependencies

This data connector requires exactly one dependency, which provides the attribute identified by the sourceAttributeID attribute.

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="dc:StoredId" xmlns="urn:mace:shibboleth:2.0:resolver:dc"
                        id="UNIQUE_ID"
                        sourceAttributeID="SOME_ID"
                        generatedAttributeID="OUTPUT_UNIQUE_ID"
                        salt="ThisIsRandomText">

     <resolver:Dependency ref="DEFINITION_ID_1" />

    <!-- Remaining configuration from the next steps go here -->

</resolver:DataConnector>

4a. Define Identity Provider (Application) Managed Database Connections

Deployers wishing to allow the data connector to manage connections to the database should follow these instructions, those wishing to allow the Servlet container to manage the connections should use the instructions in step 4b.

Identity Provider (application) managed connections are defined by a <ApplicationManagedConnection> element with the following attributes:

<resolver:DataConnector xsi:type="dc:StoredId" xmlns="urn:mace:shibboleth:2.0:resolver:dc"
                        id="UNIQUE_ID"
                        sourceAttributeID="SOME_ID"
                        generatedAttributeID="OUTPUT_UNIQUE_ID"
                        salt="ThisIsRandomText">

     <resolver:Dependency ref="DEFINITION_ID_1" />

     <ApplicationManagedConnection jdbcDriver="DRIVER_CLASS"
                                   jdbcURL="DATABASE_URL"
                                   jdbcUserName="DATABASE_USER"
                                   jdbcPassword="DATABASE_USER_PASSWORD" />

</resolver:DataConnector>

In order to use a database you must place the JDBC driver, for your database, in the IDP_SRC/lib directory. You must then rerun the install script (to generate a new WAR) and eventually restart your servlet container.

Advanced Options

The <ApplicationManagedConnection> element also allows the following, advanced, configuration attributes controlling how connections are pooled:

4b. Define Container Managed Database Connections

Configuration that use container managed connections can not be tested from the command line.

Deployers wishing to have their Servlet container manage connections to a database should follow these instructions, those wishing to allow the data connector to manage the connections should use the instructions in step 4a.

Servlet container managed connections are defined by a <ContainerManagedConnection> element with the following attributes:

The <ContainerManagedConnection> may also contain any number of <JNDIConnectionProperty> elements that specify the JNDI connection properties appropriate for the container. Refer to your container documentation for these properties. Some common JNDI connection parameters are listed by Sun.

<resolver:DataConnector xsi:type="dc:StoredId" xmlns="urn:mace:shibboleth:2.0:resolver:dc"
                        id="UNIQUE_ID"
                        sourceAttributeID="SOME_ID"
                        generatedAttributeID="OUTPUT_UNIQUE_ID"
                        salt="ThisIsRandomText">

     <resolver:Dependency ref="DEFINITION_ID_1" />

     <ContainerManagedConnection resourceName="RESOURCE_NAME"  />
</resolver:DataConnector>

In order to use a database you must place the JDBC driver, for your database, in your servlet's classpath and restart your servlet container. Refer to your servlet container's documentation for instructions.