# Unable to access end-user IP in a Rule

**URL:** <https://community.auth0.com/t/unable-to-access-end-user-ip-in-a-rule/7504>\
**Category:** Get Help\
**Tags:** ip, rules, user\
**Created:** [July 13, 2017, 5:22pm UTC](https://community.auth0.com/t/unable-to-access-end-user-ip-in-a-rule/7504 "2017-07-13T17:22:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrea.coiro](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/andrea.coiro/32/7800_2.png) [@andrea.coiro](https://community.auth0.com/u/andrea.coiro)\
**Post date:** [July 13, 2017, 5:22pm UTC](https://community.auth0.com/t/unable-to-access-end-user-ip-in-a-rule/7504/1 "2017-07-13T17:22:54Z")

</div>

Hello,  
We are sending the end-user IP via the header `auth0-forwarded-for` as documented at [https://auth0.com/docs/api-auth/tutorials/using-resource-owner-password-from-server-side](https://auth0.com/docs/api-auth/tutorials/using-resource-owner-password-from-server-side).

Everything works fine, I can see that the brute force protection is reading the right IP address (dashboard → user profile → blocked\_for)

However, when I try to access the IP in a Rule with `context.request.ip`, I still get the IP of our server. Is there a way to get the end-user IP?

I was also surprised (and confused) to see that the dashboard (“users” and “logs” sections) are also showing the server IP instead of the end-user IP.

Thanks in advance,  
Andy

---

<div class="post-metadata">

**Author:** ![prashantT](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/prashantt/32/6002_2.png) [@prashantT](https://community.auth0.com/u/prashantT)\
**Post date:** [July 17, 2017, 10:44am UTC](https://community.auth0.com/t/unable-to-access-end-user-ip-in-a-rule/7504/2 "2017-07-17T10:44:07Z")

</div>

As of now, the `auth0-forwarded-for` header is only applicable and used by Anomaly Detection features. There is discussion about expanding this to be available Rules, and I have passed on your feedback internally, however we have no ETA or commitment as to whether this will be implemented.

Can you please provide more information on your user case for us to evaluate.

---

<div class="post-metadata">

**Author:** ![andrea.coiro](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/andrea.coiro/32/7800_2.png) [@andrea.coiro](https://community.auth0.com/u/andrea.coiro)\
**Post date:** [July 17, 2017, 1:20pm UTC](https://community.auth0.com/t/unable-to-access-end-user-ip-in-a-rule/7504/3 "2017-07-17T13:20:19Z")

</div>

We have an IP blacklist, we need to prevent logins with those IP addresses. We could perform the IP check after we call your password grant endpoint, but a Rule feels more appropriate.

---

<div class="post-metadata">

**Author:** ![andrea.coiro](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/andrea.coiro/32/7800_2.png) [@andrea.coiro](https://community.auth0.com/u/andrea.coiro)\
**Post date:** [July 17, 2017, 4:23pm UTC](https://community.auth0.com/t/unable-to-access-end-user-ip-in-a-rule/7504/4 "2017-07-17T16:23:11Z")

</div>

Besides the IP blacklist, it would be nice in general to be able to retrieve the real user IP via an API and/or in the dashboard.

---

<div class="post-metadata">

**Author:** ![andrea.coiro](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/andrea.coiro/32/7800_2.png) [@andrea.coiro](https://community.auth0.com/u/andrea.coiro)\
**Post date:** [July 17, 2017, 1:20pm UTC](https://community.auth0.com/t/unable-to-access-end-user-ip-in-a-rule/7504/5 "2017-07-17T13:20:19Z")

</div>

We have an IP blacklist, we need to prevent logins with those IP addresses. We could perform the IP check after we call your password grant endpoint, but a Rule feels more appropriate.

---

<div class="post-metadata">

**Author:** ![andrea.coiro](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/andrea.coiro/32/7800_2.png) [@andrea.coiro](https://community.auth0.com/u/andrea.coiro)\
**Post date:** [July 17, 2017, 4:23pm UTC](https://community.auth0.com/t/unable-to-access-end-user-ip-in-a-rule/7504/6 "2017-07-17T16:23:11Z")

</div>

Besides the IP blacklist, it would be nice in general to be able to retrieve the real user IP via an API and/or in the dashboard.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 2, 2018, 5:55am UTC](https://community.auth0.com/t/unable-to-access-end-user-ip-in-a-rule/7504/7 "2018-03-02T05:55:21Z")

</div>


