@Bean
        @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
        @ConditionalOnMissingBean(name = PrincipalResolver.BEAN_NAME_GLOBAL_PRINCIPAL_ATTRIBUTE_REPOSITORY)
        public RegisteredServicePrincipalAttributesRepository globalPrincipalAttributeRepository(final CasConfigurationProperties casProperties) {
            val props = casProperties.getAuthn().getAttributeRepository().getCore();
            val cacheTime = props.getExpirationTime();
            if (cacheTime <= 0) {
                LOGGER.warn("Caching for the global principal attribute repository is disabled");
                return new DefaultPrincipalAttributesRepository();
            }
            return new CachingPrincipalAttributesRepository(props.getExpirationTimeUnit().toUpperCase(Locale.ENGLISH), cacheTime);
        }
This is {@link CasCoreAuthenticationPrincipalConfiguration}.

@author Misagh Moayyed
@since 5.1.0
core/cas-server-core-authentication/src/main/java/org/apereo/cas/config/CasCoreAuthenticationPrincipalConfiguration.java