0

Is possible to get the users IP that triggered the API call on WSO2 API Manager and pass it on to the call?

Any help how to do this please

Brian
  • 197
  • 4
  • 14

1 Answers1

3

You can add following property before calling endpoint (before send mediator) to your api to get the ip of user

<property name="client_ip_address"
                   expression="get-property('axis2','REMOTE_ADDR')"
                   scope="transport"
                   type="STRING"/>

Since the scope is set to transport the client_ip_address is set as a header of outgoing message. You will be able to see something similar to below log when the wire is enabled.

[2016-01-21 15:44:10,187] DEBUG - wire << "client_ip_address: 172.22.99.122[\r][\n]"

Hope this will help you.