How can you get the IP address using a global variable or by querying some kind of a setup record? I've looked at LoginHistory.obj, LoginIP, LoginGeo, but none of them show current data. $UserInfo does not have the IP Address field either.

My goal is to compare user's current IP Address to the list of trusted IP ranges in the Login Flow.

I see how you can invoke apex from the flow, and run ApexPages.currentPage() and then get IP Address from the page headers, but I want a different solution, something simpler.


You can use LoginFlow_IpAddress to get the user’s current IP address and LoginFlow_LoginIpAddress for user’s IP address used during login, which can change after authentication. See list of LoginFlow variables available.

Check login flow example here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.