Hi,
I have a nodejs application that calls the /sso/v1/sdk/authenticate api for authentication.
https://docs.oracle.com/en/cloud/paas/identity-cloud/rest-api/op-sso-v1-sdk-authenticate-post.html
The api is called in a server side function using axios. When we collect the idcs logs, we noticed that the clientIp property always shows the server's ip. This makes sense in that the api is being called in a server side function. Is there a way I can pass the client's real ip to the IDCS api so that the logs display the actual client ip instead of the server ip. The Call is as below :-
Appreciate any help in this regard.
// Capture the real client IP address
const clientIp = req.headers['x-forwarded-for']?.split(',')[0] ||
req.headers['x-real-ip'] ||
req.socket.remoteAddress ||
req.socket.remoteAddress ||
req.ip;
const sdkAuthResponse = await axios.post(process.env.IDCS_URL+'/sso/v1/sdk/authenticate', bodyreq, {
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + bearerToken,
'X-Client-IP': clientIp,
'X-Forwarded-For': clientIp,
'X-Real-IP': clientIp
}
});