Dies ist eine alte Version des Dokuments!


Vorbereitungen auf Shibboleth IdP 5.x

JDK 17 erforderlich

Dieser Schritt kann erst auf einem Server mit JDK 17 erfolgen.

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

Die Datenbank-Verbindung wird im IdP 5.x nicht mehr über den JPA Storage Service hergestellt, sondern über den JDBC Storage Service. Mit folgenden Schritten stellen Sie den IdP um:

  1. Sicherstellen, dass mindestens die Spalten context und id in der Tabelle StorageRecords case-sensitive behandelt werden.
    • Prüfen Sie die COLLATION. Eine Collation, deren Name auf _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.
      root@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)
    • In der Dokumentation Ihrer Datenbank-Software finden Sie die Umstellungsmöglichkeiten und Hinweise, was ggf. bzgl. der Länge der Werte zu beachten ist (hier etwa für MariaDB).
    • Um die Collation für die ganze Tabelle StorageRecords umzustellen, gehen Sie wie folgt vor:
      MariaDB[idp]> ALTER TABLE StorageRecords CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
  2. Installation des JDBC-Plugins (ab 4.2):
    root@idp:~# /opt/shibboleth-idp/bin/plugin.sh -I net.shibboleth.plugin.storage.jdbc
  3. Änderung der Konfiguration in 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:maxWait="15000"
                  p:testOnBorrow="true"									              p:testOnBorrow="true"
                  p:maxActive="100"										              p:maxActive="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="shibboleth.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" />			      <
        												      <
  4. Falls in Ihrer conf/idp.properties noch shibboleth.JPAStorageService vorkommt, ersetzen Sie die Stellen durch shibboleth.StorageService.
    # Set to "shibboleth.StorageService" for server-side storage of user sessions
    idp.session.StorageService = shibboleth.StorageService
     
    # Set to "shibboleth.StorageService" or custom bean for alternate storage of consent
    idp.consent.StorageService = shibboleth.StorageService
  • Zuletzt geändert: vor 11 Monaten