@Override
    protected BigDecimal calculateScore(final ClientInfo clientInfo, final Authentication authentication,
                                        final RegisteredService service, final List<? extends CasEvent> events) {
        val loc = HttpRequestUtils.getHttpServletRequestGeoLocation(clientInfo.getGeoLocation());
        if (loc.isValid()) {
            LOGGER.debug("Filtering authentication events for geolocation [{}]", loc);
            val count = events.stream().filter(e -> e.getGeoLocation().equals(loc)).count();
            LOGGER.debug("Total authentication events found for [{}]: [{}]", loc, count);
            return calculateScoreBasedOnEventsCount(authentication, events, count);
        }
        val remoteAddr = ClientInfoHolder.getClientInfo().getClientIpAddress();
        LOGGER.debug("Filtering authentication events for location based on ip [{}]", remoteAddr);
        val response = geoLocationService.locate(remoteAddr);
        if (response != null) {
            val locationRequest = new GeoLocationRequest(response.getLatitude(), response.getLongitude());
            val count = events
                .stream()
                .filter(e -> e.getGeoLocation().equals(locationRequest))
                .count();
            LOGGER.debug("Total authentication events found for location of [{}]: [{}]", remoteAddr, count);
            return calculateScoreBasedOnEventsCount(authentication, events, count);
        }
        LOGGER.debug("Request does not contain enough geolocation data");
        return AuthenticationRiskScore.highestRiskScore().getScore();
    }
This is {@link GeoLocationAuthenticationRequestRiskCalculator}.

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