Die Datenbank-Verbindung wird im IdP 5.x nicht mehr über den JPA Storage Service hergestellt, sondern über den JDBC Storage Service. Falls Sie das Plugin noch nicht installiert haben, geht es mit der Installation hier weiter. Ansonsten können Sie diesen Punkt überspringen.
Mittels Plugin-Installationsprogramm lassen Sie sich die installierten Plugins und deren Status anzeigen:
root@idp:~# /opt/shibboleth-idp/bin/plugin.sh -fl
Möglicher Output:
Plugin: net.shibboleth.plugin.storage.jdbc Current Version: 1.0.3 Versions 1.0.4: Min=4.1.0 Max=5.0.0 Support level: Current 1.0.1: Min=4.1.0 Max=5.0.0 Support level: OutOfDate 1.0.0: Min=4.1.0 Max=5.0.0 Support level: OutOfDate 1.0.3: Min=4.1.0 Max=5.0.0 Support level: OutOfDate 1.0.2: Min=4.1.0 Max=5.0.0 Support level: OutOfDate 2.0.0: Min=5.0.0 Max=6.0.0 Support level: Current
Mit folgenden Schritten stellen Sie den IdP um:
context und id in der Tabelle StorageRecords case-sensitive behandelt werden._ci endet, ist case-insensitive,_cs steht für case-sensitive, utf8_bin ist ebenfalls case-sensitive. Ab MariaDB heißt es utf8_mb3 statt utf8.MariaDB[idp]> show create table StorageRecords\G; *************************** 1. row *************************** Table: StorageRecords Create Table: CREATE TABLE `StorageRecords` ( `context` varchar(255) NOT NULL, `id` varchar(255) NOT NULL, `expires` bigint(20) DEFAULT NULL, `value` longtext NOT NULL, `version` bigint(20) NOT NULL, PRIMARY KEY (`context`,`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin 1 row in set (0.000 sec)
root@idp:~# /opt/shibboleth-idp/bin/plugin.sh -I net.shibboleth.plugin.storage.jdbc
conf/global.xml: <!-- VORHER --> | <!-- NACHHER -->
<bean id="shibboleth.MySQLDataSource" <bean id="shibboleth.MySQLDataSource"
class="%{mysql.class}" class="%{mysql.class}"
p:driverClassName="org.mariadb.jdbc.Driver" p:driverClassName="org.mariadb.jdbc.Driver"
p:url="%{mysql.url}" p:url="%{mysql.url}"
p:username="%{mysql.username}" p:username="%{mysql.username}"
p:password="%{mysql.password}" p:password="%{mysql.password}"
p:maxWait="15000" | p:maxWaitMillis="15000"
p:testOnBorrow="true" p:testOnBorrow="true"
p:maxActive="100" | p:maxTotal="100"
p:maxIdle="100" p:maxIdle="100"
p:validationQuery="select 1" p:validationQuery="select 1"
p:validationQueryTimeout="5" /> p:validationQueryTimeout="5" />
<bean id="shibboleth.JPAStorageService" | <bean id="JDBCStorageService"
class="org.opensaml.storage.impl.JPAStorageService" | parent="shibboleth.JDBCStorageService"
p:cleanupInterval="%{idp.storage.cleanupInterval:PT10M}" p:cleanupInterval="%{idp.storage.cleanupInterval:PT10M}"
c:factory-ref="shibboleth.JPAStorageService.EntityManagerFactory" /> | p:dataSource-ref="shibboleth.MySQLDataSource" />
<bean id="shibboleth.JPAStorageService.EntityManagerFactory" <
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> <
<property name="packagesToScan" value="org.opensaml.storage.impl"/> <
<property name="dataSource" ref="shibboleth.MySQLDataSource"/> <
<property name="jpaVendorAdapter" ref="shibboleth.JPAStorageService.JPAVendorAdapter"/> <
<property name="jpaDialect"> <
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaDialect" /> <
</property> <
</bean> <
<
<bean id="shibboleth.JPAStorageService.JPAVendorAdapter" <
class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" <
p:generateDdl="true" <
p:database="MYSQL" <
p:databasePlatform="org.hibernate.dialect.MySQL5Dialect" /> <
<
conf/idp.properties noch shibboleth.JPAStorageService vorkommt, ersetzen Sie die Stellen durch JDBCStorageService.idp.session.StorageService = JDBCStorageService idp.consent.StorageService = JDBCStorageService
conf/idp.properties angepasst:mysql.class = org.apache.commons.dbcp2.BasicDataSource
shibboleth.JPAStorageService auch in den Dateien conf/oidc.properties…idp.oidc.dynreg.StorageService = JDBCStorageService
… und/oder conf/oidc-clientinfo-resolvers.xml ersetzen müssen.
<bean id="StorageClientInformationResolver" parent="shibboleth.oidc.StorageClientInformationResolver" p:storageService-ref="JDBCStorageService" />
Eine Voraussetzung für den Betrieb des IdP 5.x ist JDK 17. Ab dem Java Development Kit 15 wird die Javascript Scripting Engine Nashorn nicht mehr mit ausliefert. Der IdP benötigt sie jedoch, um ggf. die Javascript-Anteile bei der Definition von Scripted Attributes in conf/attribute-resolver.xml auszuführen. Sie können die Funktionalität über das Nashorn-Plugin ergänzen. Es muss lediglich installiert, aber nicht konfiguriert werden (ab 4.2):
root@idp:~# /opt/shibboleth-idp/bin/plugin.sh -I net.shibboleth.idp.plugin.nashorn