@ConditionalOnMissingBean(name = MultifactorAuthenticationTrustStorage.BEAN_NAME)
        @Bean
        @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
        public MultifactorAuthenticationTrustStorage mfaTrustEngine(
            final CasConfigurationProperties casProperties,
            @Qualifier("mfaTrustCipherExecutor")
            final CipherExecutor mfaTrustCipherExecutor,
            @Qualifier("mfaTrustRecordKeyGenerator")
            final MultifactorAuthenticationTrustRecordKeyGenerator mfaTrustRecordKeyGenerator) {
            val trusted = casProperties.getAuthn().getMfa().getTrusted();
            val storage = Caffeine.newBuilder().initialCapacity(INITIAL_CACHE_SIZE)
                .maximumSize(MAX_CACHE_SIZE).expireAfter(new MultifactorAuthenticationTrustRecordExpiry()).build(s -> {
                    LOGGER.error("Load operation of the cache is not supported.");
                    return null;
                });
            return FunctionUtils.doIf(trusted.getJson().getLocation() != null, () -> {
                LOGGER.debug("Storing trusted device records inside the JSON resource [{}]", trusted.getJson().getLocation());
                return new JsonMultifactorAuthenticationTrustStorage(casProperties.getAuthn().getMfa().getTrusted(),
                    mfaTrustCipherExecutor, trusted.getJson().getLocation(),
                    mfaTrustRecordKeyGenerator);
            }, () -> {
                LOGGER.warn("Storing trusted device records in runtime memory. Changes and records will be lost upon CAS restarts");
                return new InMemoryMultifactorAuthenticationTrustStorage(
                    casProperties.getAuthn().getMfa().getTrusted(),
                    mfaTrustCipherExecutor, storage, mfaTrustRecordKeyGenerator);
            }).get();
        }
This is {@link MultifactorAuthnTrustConfiguration}.

@author Misagh Moayyed
@since 5.0.0
support/cas-server-support-trusted-mfa/src/main/java/org/apereo/cas/config/MultifactorAuthnTrustConfiguration.java