Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
de:shibidp:config-storage [2022/09/01 15:40] – [Datenbank und Tabellen anlegen] utf8_bin collation for case sensitivity Silke Meyerde:shibidp:config-storage [2024/11/15 09:58] (aktuell) – [Installation] Doreen Liebenau
Zeile 18: Zeile 18:
  
 ==== Installation ==== ==== Installation ====
 +1. Im einfachsten Fall installieren Sie auf dem IdP einen lokalen Datenbank-Server. Sie können natürlich auch entfernte Datenbanken über das Netzwerk einbinden. 
 + 
 <code bash> <code bash>
 root@idp:~# apt install mariadb-server mariadb-client libmariadb-java root@idp:~# apt install mariadb-server mariadb-client libmariadb-java
Zeile 24: Zeile 25:
  
 <code bash> <code bash>
-root@idp:~# ln -s /usr/share/java/mariadb-java-client.jar /var/lib/tomcat9/lib/mariadb-java-client.jar+root@idp:~# ln -s /usr/share/java/mariadb-java-client.jar /var/lib/tomcat10/lib/mariadb-java-client.jar
 </code> </code>
  
-Starten Sie Tomcat neu um die neuen Einstellungen zu aktivieren:+2. Starten Sie Tomcat neu um die neuen Einstellungen zu aktivieren:
  
 <code bash> <code bash>
-root@idp:~# systemctl restart tomcat9+root@idp:~# systemctl restart tomcat10
 </code> </code>
 +
 +3. Installieren Sie schließlich im IdP das JDBC-Plugin, falls noch nicht geschehen:<code bash>root@idp:~# /opt/shibboleth-idp/bin/plugin.sh -I net.shibboleth.plugin.storage.jdbc</code>
  
 ==== Datenbank und Tabellen anlegen ==== ==== Datenbank und Tabellen anlegen ====
  
 Die Datenbank und der Datenbank-Benutzeraccount müssen manuell erstellt werden. Dann werden noch zwei Tabellen angelegt:  Die Datenbank und der Datenbank-Benutzeraccount müssen manuell erstellt werden. Dann werden noch zwei Tabellen angelegt: 
-  * ''StorageRecords'' für Sessions und User Consent-Informationen+  * ''StorageRecords'' für Sessions und User Consent-Informationen (die COLLATION muss case-sensitive sein, hier utf8_bin)
   * ''shibpid'' für die persistentIds   * ''shibpid'' für die persistentIds
  
Zeile 74: Zeile 77:
 </code> </code>
  
-==== JPAStorageService konfigurieren ====+==== JDBCStorageService konfigurieren ====
  
-Der DB-Zugriff wird über den [[https://wiki.shibboleth.net/confluence/display/IDP4/StorageConfiguration#StorageConfiguration-JPAStorageService|JPAStorageService]] gekapselt. Dieser wird in ''./conf/global.xml'' definiert. Diese Datei ist im Auslieferungszustand leer (bis auf Kommentare). Füllen Sie sie wie folgt:+Der DB-Zugriff wird über den [[https://shibboleth.atlassian.net/wiki/spaces/IDPPLUGINS/pages/2989096970/JDBCStorageService|JDBCStorageService]] hergestellt. Dieser wird in ''./conf/global.xml'' definiert. Diese Datei ist im Auslieferungszustand leer (bis auf Kommentare). Füllen Sie sie wie folgt:
  
 <file xml ./conf/global.xml> <file xml ./conf/global.xml>
Zeile 96: Zeile 99:
          
     <!-- Die folgenden Werte sind Default-Werte:     <!-- Die folgenden Werte sind Default-Werte:
-         p:maxActive="100" +           p:maxTotal="100" 
-         p:maxIdle="100"+           p:maxIdle="100"
          Es ist unter Umständen nötig, dass Sie diese Werte je nach Auslastung Ihres IdP anpassen,          Es ist unter Umständen nötig, dass Sie diese Werte je nach Auslastung Ihres IdP anpassen,
          ebenso wie die Konfiguration Ihres MySQL-Servers. -->          ebenso wie die Konfiguration Ihres MySQL-Servers. -->
- 
         <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:maxTotal="100
-              p:testOnBorrow="true+          p:maxIdle="100
-              p:maxActive="100+          p:maxWaitMillis="15000
-              p:maxIdle="100+          p:testOnBorrow="true
-              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" /> +
 </beans> </beans>
 </file> </file>
Zeile 140: Zeile 126:
 ==== Datenbank-Credentials hinterlegen ==== ==== Datenbank-Credentials hinterlegen ====
  
-Die Properties für den Datenbank-Zugriff werden jetzt noch in ''./conf/idp.properties'' ergänzt:+1. Die Shibboleth-Entwickler empfehlen nicht mehr das tomcat-pooling zu verwenden, sondern 
 +[[https://shibboleth.atlassian.net/wiki/spaces/IDPPLUGINS/pages/2989096970/JDBCStorageService#Connection-Pooling | DBCP 2]]. Die Properties für den Datenbank-Zugriff werden jetzt noch entsprechend in ''./conf/idp.properties'' ergänzt:
  
 <file java /opt/shibboleth-idp/conf/idp.properties> <file java /opt/shibboleth-idp/conf/idp.properties>
 # ... # ...
-mysql.class    = org.apache.tomcat.jdbc.pool.DataSource+mysql.class    = org.apache.commons.dbcp2.BasicDataSource
 mysql.url      = jdbc:mysql://localhost:3306/shibboleth mysql.url      = jdbc:mysql://localhost:3306/shibboleth
 mysql.username = shibboleth mysql.username = shibboleth
Zeile 150: Zeile 137:
 </file> </file>
  
-Das Passwort gehört wieder in die Datei ''./credentials/secrets.properties'':+2. Das Passwort gehört wieder in die Datei ''./credentials/secrets.properties'':
 <file /opt/shibboleth-idp/credentials/secrets.properties> <file /opt/shibboleth-idp/credentials/secrets.properties>
 mysql.password = GeHEIM007 mysql.password = GeHEIM007
 </file> </file>
  
-Starten Sie Tomcat neu, um sicherzustellen, dass die ''./conf/global.xml'' ohne Probleme eingelesen werden kann:+3. Starten Sie Tomcat neu, um sicherzustellen, dass die ''./conf/global.xml'' ohne Probleme eingelesen werden kann:
  
 <code bash> <code bash>
-root@idp:~# systemctl restart tomcat9+root@idp:~# systemctl restart tomcat10
 </code> </code>
  
Zeile 187: Zeile 174:
 </file> </file>
  
-Der Salt-Hash, mit dem die persistentIds generiert werden, wird aus Sicherheitsgründen in der zugriffsbeschränkten Passwortdatei ''./credentials/secrets.properties'' hinterlegt. Er sollte möglichst lang und beliebig sein und mit niemandem geteilt werden.+Der Salt-Hash, mit dem die persistentIds generiert werden, wird aus Sicherheitsgründen in der zugriffsbeschränkten Passwortdatei ''./credentials/secrets.properties'' hinterlegt. Er sollte möglichst beliebig, also zufällig generiert, und möglichst lang sein und mit niemandem geteilt werden.
  
 <file properties /opt/shibboleth-idp/credentials/secrets.properties> <file properties /opt/shibboleth-idp/credentials/secrets.properties>
 +# Bitte durch einen zufällig generierten Salt ersetzen!
 idp.persistentId.salt = my-very-very-long-hash idp.persistentId.salt = my-very-very-long-hash
  
Zeile 269: Zeile 257:
 ... ...
 # Set to "shibboleth.StorageService" for server-side storage of user sessions # Set to "shibboleth.StorageService" for server-side storage of user sessions
-idp.session.StorageService = shibboleth.JPAStorageService+idp.session.StorageService = JDBCStorageService
  
 # Set to "shibboleth.StorageService" or custom bean for alternate storage of consent # Set to "shibboleth.StorageService" or custom bean for alternate storage of consent
-idp.consent.StorageService = shibboleth.JPAStorageService+idp.consent.StorageService = JDBCStorageService
  
 # Set to "shibboleth.consent.AttributeConsentStorageKey" to use an attribute # Set to "shibboleth.consent.AttributeConsentStorageKey" to use an attribute
Zeile 310: Zeile 298:
  
 <code bash> <code bash>
-root@idp:~# systemctl restart tomcat9+root@idp:~# systemctl restart tomcat10
 </code> </code>
  
 ===== Weitergabe der Persistent ID ===== ===== Weitergabe der Persistent ID =====
  
-Um in den Fällen, in denen ein anfragender SP keine Präferenzen bzgl. Name ID Format signalisiert (Metadaten und/oder AuthnRequest), eine Gewichtung festzulegen (siehe hierzu die [[https://wiki.shibboleth.net/confluence/display/IDP30/NameIDGenerationConfiguration#NameIDGenerationConfiguration-FormatSelectionFormatSelection|Doku im Shibboleth-Wiki]]), kann die SAML2.SSO-Bean-Definition **bei Bedarf**  entsprechend erweitert werden:+Um in den Fällen, in denen ein anfragender SP keine Präferenzen bzgl. Name ID Format signalisiert (Metadaten und/oder AuthnRequest), eine Gewichtung festzulegen (siehe hierzu die [[https://shibboleth.atlassian.net/wiki/spaces/IDP5/pages/3199507810/NameIDGenerationConfiguration|Doku im Shibboleth-Wiki]]), kann die SAML2.SSO-Bean-Definition **bei Bedarf**  entsprechend erweitert werden:
  
 <file xml /conf/relying-party.xml> <file xml /conf/relying-party.xml>
Zeile 338: Zeile 326:
  
 <code bash> <code bash>
-root@idp:/opt/shibboleth-idp# systemctl restart tomcat9+root@idp:/opt/shibboleth-idp# systemctl restart tomcat10
 </code> </code>
  
  • Zuletzt geändert: vor 3 Jahren