protected boolean isRiskyAuthenticationAcceptable(final Authentication authentication,
                                                      final AuthenticationRiskScore score) {
        val historyWindow = Beans.newDuration(casProperties.getAuthn().getAdaptive()
            .getRisk().getResponse().getGetRiskVerificationHistory());
        return casEventRepository.getEventsOfTypeForPrincipal(
                CasRiskyAuthenticationVerifiedEvent.class.getName(),
                authentication.getPrincipal().getId(),
                ZonedDateTime.now(Clock.systemUTC()).minus(historyWindow))
            .anyMatch(event ->
                event.getClientIpAddress().equalsIgnoreCase(score.getClientInfo().getClientIpAddress())
                    && event.getAgent().equalsIgnoreCase(score.getClientInfo().getUserAgent()));
    }
This is {@link DefaultAuthenticationRiskEvaluator}.

@author Misagh Moayyed
@since 5.1.0
support/cas-server-support-electrofence/src/main/java/org/apereo/cas/impl/engine/DefaultAuthenticationRiskEvaluator.java