# Rule to disallow users with same IP as existing logged in users from logging in

**URL:** <https://community.auth0.com/t/rule-to-disallow-users-with-same-ip-as-existing-logged-in-users-from-logging-in/56740>\
**Category:** Get Help\
**Tags:** rules, login, auth0\
**Created:** [January 25, 2021, 12:20pm UTC](https://community.auth0.com/t/rule-to-disallow-users-with-same-ip-as-existing-logged-in-users-from-logging-in/56740 "2021-01-25T12:20:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sargent\_D](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sargent_d/32/12814_2.png) [@Sargent\_D](https://community.auth0.com/u/Sargent_D)\
**Post date:** [January 25, 2021, 12:20pm UTC](https://community.auth0.com/t/rule-to-disallow-users-with-same-ip-as-existing-logged-in-users-from-logging-in/56740/1 "2021-01-25T12:20:45Z")

</div>

I have a requirement where if a user is logged in and another user tries to login on the same machine, we need to disallow them since the first user is already logged in from that machine. I was thinking of using a rule for this but I am not sure how to implement checking a user’s IP against the list of IPs of all logged in users.

So, could someone please give me some pointers in this regard?

Thanks.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [January 25, 2021, 8:27pm UTC](https://community.auth0.com/t/rule-to-disallow-users-with-same-ip-as-existing-logged-in-users-from-logging-in/56740/3 "2021-01-25T20:27:12Z")

</div>

Hi @Sargent_D,

Are you sure all of your users will have a distinct IP? Separate users could share an IP for a number of reasons.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [February 12, 2021, 6:21pm UTC](https://community.auth0.com/t/rule-to-disallow-users-with-same-ip-as-existing-logged-in-users-from-logging-in/56740/4 "2021-02-12T18:21:57Z")

</div>

Closing as inactive.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [February 12, 2021, 6:22pm UTC](https://community.auth0.com/t/rule-to-disallow-users-with-same-ip-as-existing-logged-in-users-from-logging-in/56740/5 "2021-02-12T18:22:20Z")

</div>


