Hi AJ,

have you managed to resolve the issue? Do I expect it correctly that 
the mmdb files referenced in your CAS properties are not just the example 
ones?

Regarding the slash, it seems like the extra slash before the logged IP 
address should be just fine, because that's how 
*java.net.InetAddress#toString()* is implemented:

    public String toString() {
        String hostName = holder().getHostName();
        return Objects.toString(hostName, "")
            + "/" + getHostAddress();
    }

Regards
Petr
On Friday, 27 June 2025 at 18:06:26 UTC+2 AJ wrote:

> Just to update, this behavior is the same in CAS 7.2.4.
>
> 2025-06-27 11:52:03,261 DEBUG 
> [org.apereo.cas.support.geo.maxmind.MaxmindDatabaseGeoLocationService] - 
> <Geo location for [/x.x.x.x] is calculated as 
> [GeoLocationResponse(addresses=[], latitude=0.0, longitude=0.0)]>
>
> None of the Geolocation services work, all return zeroes.
>
>
>
> ------------------------------
> *From:* AJ <[email protected]>
> *Sent:* Wednesday, June 25, 2025 12:12 PM
> *To:* CAS Community <[email protected]>
> *Subject:* Re: CAS 7.2.x Geolocation
>  
> I've turned up logging to trace and I see the following for both Azure and 
> Maxmind services.
>
>  <Geo location for [/x.x.x.x] is calculated as 
> [GeoLocationResponse(addresses=[], latitude=0.0, longitude=0.0)]>
>
> It looks like it's trying to resolve the geolocation, but it always 
> returns 0's.  Looking the IP up manually from the service of course returns 
> the proper results.
> Only thing I notice is there is a forward slash (/) in front of the IP 
> address. 
>
> Thanks.
>
> ------------------------------
> *From:* AJ
> *Sent:* Wednesday, June 25, 2025 10:03 AM
> *To:* CAS Community <[email protected]>
> *Subject:* CAS 7.2.x Geolocation
>  
> Has anyone gotten geolocation data to actually be written to the events 
> system without having to have user consent in their browsers?
> I have tried various geo location services, Maxmind, IP, Azure and none of 
> them work.  The only time it works is if the user is prompted in the 
> browser and they accept.
> I'm looking to capture geolocation data based on their IP address only.  
>
> I have these settings:
>
> cas.tgc.geo-locate-client-session=true
> cas.authn.adaptive.risk.geo-location.enabled=true
> cas.authn.adaptive.risk.ip.enabled=true
> cas.events.core.enabled=true
> cas.events.core.track-geolocation=true
>
> cas.geo-location.maxmind.city-database=/etc/cas/config/geodb/geoip-city.mmdb
>
> cas.geo-location.maxmind.country-database=/etc/cas/config/geodb/geoip-country.mmdb
>
> Obviously, I should not need user permission to just translate their IP to 
> a geolocation.
>
> If it matters, I am using MongoDB for event storage.
>
> CAS version 7.2.3
>
>
>

-- 
- Website: https://apereo.github.io/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
--- 
You received this message because you are subscribed to the Google Groups "CAS 
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/e5775af0-9f2a-47a5-95f0-4181d04b8785n%40apereo.org.

Reply via email to