@Override
    public Optional<String> extract(final Authentication authentication,
                                    final HttpServletRequest request,
                                    final HttpServletResponse response) throws Throwable {
        val loc = WebUtils.getHttpServletRequestGeoLocation(request);

        if (loc != null && loc.isValid()) {
            LOGGER.trace("Attempting to geolocate [{}]", loc);
            val geoResponse = geoLocationService.locate(loc);
            val address = geoResponse.build();
            if (StringUtils.isBlank(address)) {
                return getDefaultGeoLocation(loc);
            }
            return Optional.of(address);
        }
        LOGGER.trace("No geolocation could be determined from the request");
        return Optional.empty();
    }
Provides the geo location for device fingerprint generation.

@author Misagh Moayyed
@since 6.1.0
support/cas-server-support-trusted-mfa-core/src/main/java/org/apereo/cas/trusted/web/flow/fingerprint/GeoLocationDeviceFingerprintExtractor.java