An update to this issue, I was able to retrieve the IP address using below code in OSIN script.
ctx.getData().getJsonRequest().getHeader("X-Forwarded-For").
This works fine for POST requests. Next challenge is, for the GET request I am trying to use OSOUT script but ctx.getData() does not work in OSOUT since it is a get call and there is no request json as such. So do I retrive the request data OR headers in GET calls?
Also, another issue is since this solution is API based, if I have 100 APIs, I will have to write this code in 100 OSIN scripts. Do we have any generic place where I could write this logic and it works for all APIS?
------------------------------
Suhas Joshi
Pune
------------------------------
Original Message:
Sent: Tue April 23, 2024 03:35 AM
From: Suhas Joshi
Subject: Capture client IP address coming through OSLC call at mbo level
Hi Sanjay,
Changing log level to DEBUG did not help and we do not have load balancer configuration in lower environment. Any other way to capture IP address?
------------------------------
Suhas Joshi
Pune
------------------------------
Original Message:
Sent: Fri April 19, 2024 05:29 PM
From: SANJAY PATIL
Subject: Capture client IP address coming through OSLC call at mbo level
Hi Suhas,
Did you check in the log with DEBUG level for your OSLC/REST calls?
Also, request is entering thru your LB or Firewall, can they help you?
-Sanjay
------------------------------
SANJAY PATIL