Use of postgresql for consent storage

Erwan Colin erwan.colin at mines-albi.fr
Tue May 28 15:40:02 UTC 2024


Hello,

have you managed to set postgresql as a consent storage for shibboleth IdP V5?

I tried to do it using this page https://shibboleth.atlassian.net/wiki/spaces/IDPPLUGINS/pages/2989096970/JDBCStorageService

So I :
- installed the jdbc plugin: //opt/shibboleth-idp/bin/plugin.sh -I net.shibboleth.plugin.storage.jdbc/
- downloaded the jdbc driver https://jdbc.postgresql.org/download and put it in //opt/shibboleth-idp/edit-webapp/WEB-INF/lib/
- created the database table for the plugin to use and the table StorageRecords
- downloaded the lib apache  Commons DBCP2 and put it in //opt/shibboleth-idp/edit-webapp/WEB-INF/lib
/- set the connection in //opt/shibboleth-idp/conf/global.xml/:

/<bean id="databaseConnexionData" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close" lazy-init="true"
         p:driverClassName="org.postgresql.Driver"
        p:url="jdbc:postgresql://localhost:5432/shibboleth"
        p:username="shibboleth"
        p:retryableErrors="4001, 4002"
        p:password="%{idp.JDBCPassword}" />

     <bean id="JDBCStorageService" parent="shibboleth.JDBCStorageService"
           p:dataSource-ref="databaseConnexionData"
           p:transactionIsolation="4"
           p:retryableErrors="40001"
     />/

And when I restart my jetty service after a build I've got this errors :

/Error creating bean with name 'JDBCStorageService' defined in file [/opt/shibboleth-idp/conf/global.xml]: Cannot resolve reference to bean 'databaseConnectionSource' while setting bean property 
'dataSource'
/

Which is caused by this error (indeed the been /databaseConnectionSource/ could not been created):

/Error creating bean with name 'databaseConnectionSource' defined in file [/opt/shibboleth-idp/conf/global.xml]: Failed to instantiate [org.apache.commons.dbcp2.BasicDataSource]: Constructor threw 
exception/

Which is, indeed, cause by this exception :

/Caused by: java.lang.NoSuchFieldError: DEFAULT_DURATION_BETWEEN_EVICTION_RUNS
   at org.apache.commons.dbcp2.BasicDataSource.<init>(BasicDataSource.java:260)/

So yes it seems to be an issue with my class instanciation, but I don't know how to fix this /DEFAULT_DURATION_BETWEEN_EVICTION_RUNS/ thing.

If someone has a solution, it'd be great.

Best regards,

-- 
Erwan Colin
Ingénieur système/System engineer
IMT Mines Albi
🖁 +33 754 369 060
☎ +33 563 493 356
🚪 0A20

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/users/attachments/20240528/16b7ee78/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0xF2710398C58BD857.asc
Type: application/pgp-keys
Size: 3139 bytes
Desc: OpenPGP public key
URL: <http://shibboleth.net/pipermail/users/attachments/20240528/16b7ee78/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://shibboleth.net/pipermail/users/attachments/20240528/16b7ee78/attachment.sig>


More information about the users mailing list