# Use of X-Forwarded-For header

**URL:** <https://devforum.okta.com/t/use-of-x-forwarded-for-header/22836>\
**Category:** API\
**Created:** [December 19, 2022, 2:43pm UTC](https://devforum.okta.com/t/use-of-x-forwarded-for-header/22836 "2022-12-19T14:43:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![balakrishnar](https://avatars.discourse-cdn.com/v4/letter/b/c0e974/32.png) [@balakrishnar](https://devforum.okta.com/u/balakrishnar)\
**Post date:** [December 19, 2022, 2:43pm UTC](https://devforum.okta.com/t/use-of-x-forwarded-for-header/22836/1 "2022-12-19T14:43:31Z")

</div>

I was trying to test the behavior detection feature with API call /{{url}}/api/v1/authn.

As per the document i have added the X-forwarded-header with an IP address but logs shows my machine IP address instead of one in Xfowardedfor header value .

> **[Core Okta API | Okta Developer](https://developer.okta.com/docs/reference/core-okta-api/#pass-operating-system-information)**
>
> Learn how the Okta API works and learn about the compatibility rules and design principles.

I have trusted application run behind proxy with loadblancer. Each time it gets the LB IP address instead of users IP address. any Idea how we can achieve the right client IP address?

Thanks,  
Balakrishna

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [February 12, 2024, 10:37pm UTC](https://devforum.okta.com/t/use-of-x-forwarded-for-header/22836/2 "2024-02-12T22:37:48Z")

</div>


