I am attempting to retrieve the originating request IP address in my post-login action. I’ve noticed that within the company VPN, the request’s originating IP address appears as an IPv4 address (e.g., 192.xxx.0.xxx), while outside the VPN, it is an IPv6 address (e.g., 2406:xxx:b4:392a:b737:yyyy:9842:10e9). Is this the expected behavior, and how can I consistently obtain an IPv4 address as the response?
Here is my code for reading ip address - const ip_address = event.request.ip;
Thank you for posting your question. Yes, the behavior you’re observing regarding the IP addresses in your Auth0 Post-Login Action is expected, and without the changes in the VPN, you won’t be able to get IPv4. If the incoming request to Auth0 uses IPv6, you’ll receive that in the event.request.ip.