Search in sources :

Example 1 with U2FJpaDeviceRepository

use of org.apereo.cas.adaptors.u2f.storage.U2FJpaDeviceRepository in project cas by apereo.

the class U2FJpaConfiguration method u2fDeviceRepository.

@Bean
public U2FDeviceRepository u2fDeviceRepository() {
    final U2FMultifactorProperties u2f = casProperties.getAuthn().getMfa().getU2f();
    final LoadingCache<String, String> requestStorage = Caffeine.newBuilder().expireAfterWrite(u2f.getExpireRegistrations(), u2f.getExpireRegistrationsTimeUnit()).build(key -> StringUtils.EMPTY);
    final U2FJpaDeviceRepository repo = new U2FJpaDeviceRepository(requestStorage, u2f.getExpireRegistrations(), u2f.getExpireDevicesTimeUnit());
    repo.setCipherExecutor(this.u2fRegistrationRecordCipherExecutor);
    return repo;
}
Also used : U2FJpaDeviceRepository(org.apereo.cas.adaptors.u2f.storage.U2FJpaDeviceRepository) U2FMultifactorProperties(org.apereo.cas.configuration.model.support.mfa.U2FMultifactorProperties) Bean(org.springframework.context.annotation.Bean) LocalContainerEntityManagerFactoryBean(org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean)

Aggregations

U2FJpaDeviceRepository (org.apereo.cas.adaptors.u2f.storage.U2FJpaDeviceRepository)1 U2FMultifactorProperties (org.apereo.cas.configuration.model.support.mfa.U2FMultifactorProperties)1 Bean (org.springframework.context.annotation.Bean)1 LocalContainerEntityManagerFactoryBean (org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean)1