IP Address Audit
The X-Forwarded-For header is used to identify the originating IP address of a client connecting to a web server through a proxy server or load balancer. This is important because the IP address of the client is often used for security purposes, such as fraud identification.
When a client connects to a web server through a proxy server, the proxy server will see the client's IP address. However, the web server will only see the IP address of the proxy server. The X-Forwarded-For header allows the web server to see the client's IP address, even though the client is connecting through a proxy server.
The X-Forwarded-For header is a comma-separated list of IP addresses. The first IP address in the list is the IP address of the client. The subsequent IP addresses in the list are the IP addresses of the proxies that the client has passed through.
For example, if a client connects to a web server through two proxies, the X-Forwarded-For header might look like this:
X-Forwarded-For: 192.168.1.1, 10.0.0.1, 192.168.0.1
In this example, the client's IP address is 192.168.1.1. The first proxy server that the client passed through has an IP address of 10.0.0.1. The second proxy server that the client passed through has an IP address of 192.168.0.1.
Note: It's mandatory to pass this header for all the transfer API's and optional for all other API's.
An example request is given below:
curl --location 'https://api.dev.mbanq.cloud/v1/transfers' \
--header 'authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImlzQWNjZXNzVG9rZW4iOnRydWUsImV4cCI6MTY5MTAwMjMyNSwidXNlcklkIjoxLCJpYXQiOjE2OTA5OTg3MjV9.S2iiF85hckZ8hXG8mQjEhcrsfRy6RL-F0uxp7ScwQ2Cb4sWsx1tLwxqJ5e8PxRupRDtbqa6R6XEgw1lBJ6H0gw' \
--header 'content-type: application/json' \
--header 'tenantid: default' \
--header 'X-FORWARDED-FOR: 123.123.123.122' \
--data '{
"type": "CREDIT",
"dateFormat": "YYYY-MM-DD",
"paymentType": "ACH",
"amount": 15,
"reference": ["the quick"],
"debtor": {
"identifier": "ACCOUNT:000000018"
},
"creditor": {
"identifier": "ACH://051000017/0175380001",
"name": "David Wise",
"address": ["17 Robert Lane", "line2", "lineN"],
"country": "US",
"agent": {
"name": "BANK OF AMERICA",
"identifier": "051000017",
"address": ["17 Robert Lane", "line2", "lineN"]
}
}
}'
Updated over 1 year ago