Any function to get request ip address in AM script?

I want to get the ip of the authentication requests in a tree decision node script, for now I access request headers via variable requestHeaders and catch the header like “X-Forwarded-For” to get ip. But have one concern that if the request comes in with none ip-related header, is there some method like request.getRemoteAddr() to catch the ip directly?


1 Like

hi @CSTG_Xiaohan,

I see different approaches:

The platform is so extensible, I’m sure there many other approaches.



Thanks for the answer! Just one thing to confirm, 3rd method you mean use the scripttextoutputcallback class. This should require user to input the ip, but it can’t collect the ip automatically, rite?

yes, you should load a javascript that will collect the IP Address from the client browser. Something similar to this script Ways to Retrieve User IP Address Without Third-Party should do the job.

1 Like