JDBC Storage Service on Shibboleth IDP 5.0

Dan McLaughlin dmclaughlin at tech-consortium.com
Tue Oct 17 22:06:45 UTC 2023


Has anyone tried the latest JDBC Storage Service 2.0.0 on Shibboleth IDP 5.0?

I followed the instructions documented here:
https://shibboleth.atlassian.net/wiki/spaces/IDPPLUGINS/pages/2989096970/JDBCStorageService

I installed the plugin and can see that jdbc-storage-impl-2.0.0.jar is
in the WEB-INF/lib of the idp.war that I have deployed.

In the global.xml I have the following:

    <bean id="shibboleth.JPAStorageService"
        parent="shibboleth.JDBCStorageService"
        p:cleanupInterval="%{idp.storage.cleanupInterval:PT10M}"
        p:dataSource-ref="shibboleth.JPAStorageService.DataSource"/>

   <bean id="shibboleth.JPAStorageService.DataSource"
        class="org.apache.commons.dbcp2.BasicDataSource"
destroy-method="close" lazy-init="true"
        p:driverClassName="%{datasource.driverClass}"
        p:url="%{datasource.jdbcUrl}"
        p:username="%{datasource.user}"
        p:password="%{datasource.password}"
        p:initialSize="5"
        p:maxTotal="50"
        p:maxIdle="5"
        p:maxWaitMillis="2000"
        p:testOnBorrow="true"
        p:testWhileIdle="true"
        p:testOnReturn="true"
        p:timeBetweenEvictionRunsMillis="120000"
        p:minEvictableIdleTimeMillis="120000"
        p:validationQuery="select 1 from sysibm.sysdummy1"
        p:validationQueryTimeout="4" />

In idp.properties I set:

idp.session.StorageService = shibboleth.JPAStorageService

I created the following table in our database.

create table MYSCHEMA.STORAGERECORDS
(
    CONTEXT VARCHAR(255)  not null,
    ID      VARCHAR(255)  not null,
    EXPIRES BIGINT default NULL,
    VALUE   CLOB(1048576) not null,
    VERSION BIGINT not null,
    constraint XPKSTORAGERECORDS
        primary key (CONTEXT, ID)
);
comment on table MYSCHEMA.STORAGERECORDS is 'Used by Shibboleth
JDBCStorageService for Session State';
grant delete, insert, select, update on table MYSCHEMA.STORAGERECORDS
to CRISAPP;

My db.properties contains:

datasource.driverClass = com.ibm.db2.jcc.DB2Driver
datasource.jdbcUrl =
jdbc:db2://my.db.host:51000/MYDB:clientProgramName=ShibbolethIDP;currentSchema=MYSCHEMA;
datasource.user = appdbuser
datasource.password = mypasswordhere


There are no errors on startup or when a user logs in.  All the logs
look clean. However, when I check the STORAGERECORDS table, it's
always empty. I tried setting idp.loglevel.idp=DEBUG to see if I would
see more details, but nothing is logged.

The environment is Windows, OpenJDK 21, Tomcat 10.1.17, IBM DB2 11.5,
Shibboleth IDP 5.0 GA, jdbc-storage-impl 2.0.0.

Any ideas?

--

Thanks,

Dan


More information about the users mailing list