Is there an API for getting the current IP address that you can use in Apex code? I didn't see anything in UserInfo, and I don't want to use the LoginHistory object at all for this.
1 Answer
You should be able to query AuthSession.SourceIp
. An AuthSession
record with a SessionType
of SubstituteUser is created when you log in as another user.