Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Install the JDBC storage plugin and create a new schema/database (e.g. webauthn) and a new table (e.g. webauthn.StorageRecords):

Expand
titleJDBC WebAuthn schema example
Code Block
## This example is specific to MySQL

## Needed to support case sensitive queries in MySQL
CREATE SCHEMA IF NOT EXISTS `webauthn` 
DEFAULT CHARACTER SET latin1 
COLLATE latin1_general_cs ;

CREATE TABLE webauthn.StorageRecords (
  context varchar(255) NOT NULL,
  id varchar(255) NOT NULL,
  expires bigint DEFAULT NULL,
  value text NOT NULL,
  version bigint NOT NULL,
  PRIMARY KEY (context, id)
);
  1. Add the following beans to conf/global.xml:

Code Block
    <bean id="JDBCDataSource" class="org.mariadb.jdbc.MariaDbDataSource">
        <property name="url" value="jdbc:mariadb://localhost:3306/webauthn" />
        <property name="user" value="<user>" />
        <property name="password" value="<password>" />
    </bean>
    
    <bean id="WebAuthnStorageService" parent="shibboleth.JDBCStorageService"
        p:cleanupInterval="%{idp.storage.cleanupInterval:PT10M}" 
        p:dataSource-ref="shibboleth.JDBCDataSource"/>

...

  1. Then, configure a suitable JDBC connection by following the JDBC storage plugin documentation.

  1. Finally, set the storage service bean you want to use for WebAuthn (WebAuthnStorageService in this example) using the property idp.authn.webauthn.StorageService in conf/authn/webauthn.properties

...