You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

WORK IN PROGRESS.....

The terms of use part of the consent module in version 3 of the IdP software is a simple way to comply with the AL1 & AL2 acceptable use policy criteria. This HowTo describes how to implement this module for SWAMID IdPs. It assumes that you already have a working IdP. We strongly recommend using the IdP installer.

The terms of use part of the consent module requires an additional database storage service in order to store terms of use records. This is in addition to the persistent id table created by the IdP installer. 

Configure a storage service

The full instructions are at https://wiki.shibboleth.net/confluence/display/IDP30/StorageConfiguration. We are going to create a JPAStorageService. 

Create an extra database (storageservice) and table (StorageRecords) Here is the SQL for MySQL. Code for other databases is available at https://wiki.shibboleth.net/confluence/display/IDP30/StorageConfiguration#StorageConfiguration-JPAStorageService

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`)
)
Make sure the shibboleth database user has select, insert, update, delete access to storageservice.StorageRecords
Download a driver for the JPAStorageService. In this example we will use the HikariCP JDBC connection pool, http://brettwooldridge.github.io/HikariCP/
Place the HikariCP jar file in the edit-webapp/WEB-INF/lib directory and run bin/build.sh to rebuild the war file.
Add the following to global.xml (assumes MySQL)
<bean id="shibboleth.JPAStorageService.EntityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="persistenceUnitName" value="storageservice" />
<property name="packagesToScan" value="org.opensaml.storage.impl" />
<property name="dataSource" ref="shibboleth.JPAStorageService.DataSource" />
<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">
<property name="database" value="MYSQL" />
</bean>
<bean id="shibboleth.JPAStorageService.DataSource" 
class="com.zaxxer.hikari.HikariDataSource" destroy-method="close" lazy-init="true"
p:driverClassName="com.mysql.jdbc.Driver"
p:jdbcUrl="jdbc:mysql://localhost:3306/storageservice"
p:username="shibboleth"
p:password="XXXX" />

 

  • No labels