private long getMaxNumberOfRefreshTokensAllowed(final OAuthRegisteredService registeredService) {
        return Optional.ofNullable(registeredService)
            .map(OAuthRegisteredService::getRefreshTokenExpirationPolicy)
            .map(RegisteredServiceOAuthRefreshTokenExpirationPolicy::getMaxActiveTokens)
            .orElseGet(() -> casProperties.getAuthn().getOauth().getRefreshToken().getMaxActiveTokensAllowed());
    }
Default OAuth refresh token factory.

@author Jerome Leleu
@since 5.0.0
support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/ticket/refreshtoken/OAuth20DefaultRefreshTokenFactory.java