Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Examples of each type of bean using MySQL an unspecified database and the DBCP2 pooling library (neither are not provided with the IdP) follows:. You will need to determine what driver class to plug into the bean definition for your database and the proper URL to use. Always use current drivers when possible; bug fixes for obscure problems tend to be frequent. When in doubt, grab a newer one.

Code Block
languagexml
titleExample persistent ID store beans in saml-nameid.xml
collapsetrue
<!-- A DataSource bean suitable for use in the idp.persistentId.dataSource property. -->
<bean id="MyDataSource" class="org.apache.commons.dbcp2.BasicDataSource"
	p:driverClassName="com.mysqlexample.jdbcdatabase.Driver"
	p:url="jdbc:mysqlexample://localhost:3306/shibbolethdatabase"
	p:username="shibboleth"
	p:password="foo"
	p:maxIdle="5"
	p:maxWaitMillis="15000"
	p:testOnBorrow="true"
	p:validationQuery="select 1"
	p:validationQueryTimeout="5" />

<!-- A "store" bean suitable for use in the idp.persistentId.store property. -->
<bean id="MyPersistentIdStore" parent="shibboleth.JDBCPersistentIdStore"
	p:dataSource-ref="MyDataSource"
	p:queryTimeout="PT2S"
	p:retryableErrors="#{{'23000'}}" />

...

Code Block
languagexml
titlePre-3.2 Example ID Store in saml-nameid.xml
collapsetrue
<bean id="MyPersistentIdStore" class="net.shibboleth.idp.saml.nameid.impl.JDBCPersistentIdStore">
    <property name="dataSource">
        <bean class="org.apache.commons.dbcp2.BasicDataSource"
            			p:driverClassName="com.mysqlexample.jdbcdatabase.Driver"
            			p:url="jdbc:mysqlexample://localhost:3306/shibbolethdatabase"
            p:username="shibboleth"
            p:password="foo"
            p:maxIdle="5"
            p:maxWaitMillis="15000"
            p:testOnBorrow="true"
            p:validationQuery="select 1"
            p:validationQueryTimeout="5" />
    </property>
</bean>

...