# User's IP address inside Custom Database Login

**URL:** <https://community.auth0.com/t/users-ip-address-inside-custom-database-login/23101>\
**Category:** Get Help\
**Tags:** custom-database\
**Created:** [March 25, 2019, 8:31pm UTC](https://community.auth0.com/t/users-ip-address-inside-custom-database-login/23101 "2019-03-25T20:31:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sebastjan.stamatov](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sebastjan.stamatov/32/12013_2.png) [@sebastjan.stamatov](https://community.auth0.com/u/sebastjan.stamatov)\
**Post date:** [March 25, 2019, 8:31pm UTC](https://community.auth0.com/t/users-ip-address-inside-custom-database-login/23101/1 "2019-03-25T20:31:10Z")

</div>

Hello,

Is there a way to obtain the user’s IP address during the custom database login process? We would like to use that information for custom processing and logging in our application. Same question was asked here [Getting the client's IP address inside custom database login](http://community.auth0.com/t/getting-the-clients-ip-address-inside-custom-database-login/20656) but it was not answered.

Thank you,  
S.

---

<div class="post-metadata">

**Author:** ![James.Morrison](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/james.morrison/32/13507_2.png) [@James.Morrison](https://community.auth0.com/u/James.Morrison)\
**Post date:** [March 25, 2019, 9:26pm UTC](https://community.auth0.com/t/users-ip-address-inside-custom-database-login/23101/3 "2019-03-25T21:26:48Z")

</div>

Hey there @sebastjan.stamatov, welcome to Auth0’s Community! As stated by @konrad.sopala, this is possible through [Rules](https://auth0.com/docs/rules). It’s important to be aware that rules only are triggered upon a successful authentication request. I have quoted Konrad below who dives into what is needed to obtain the IP address. In the event you run into any issues implementing this or have found it incorrect, please let me know as I am happy to help. Thanks!

> [@Getting the client's IP address inside custom database login](https://community.auth0.com/t/getting-the-clients-ip-address-inside-custom-database-login/20656/2):
>
> **To obtain the IP address** :
> 
> - You need to access context object and its property `request` and then the `ip` property.

---

<div class="post-metadata">

**Author:** ![sebastjan.stamatov](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sebastjan.stamatov/32/12013_2.png) [@sebastjan.stamatov](https://community.auth0.com/u/sebastjan.stamatov)\
**Post date:** [March 26, 2019, 1:53pm UTC](https://community.auth0.com/t/users-ip-address-inside-custom-database-login/23101/4 "2019-03-26T13:53:10Z")

</div>

Hi James,  
Thank you for the quick response. I was hoping to get the IP address before successful authentication but that is not possible as I understand. We will probably make some modifications on our end and utilize rules instead.  
Cheers,  
Sebastjan.

---

<div class="post-metadata">

**Author:** ![James.Morrison](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/james.morrison/32/13507_2.png) [@James.Morrison](https://community.auth0.com/u/James.Morrison)\
**Post date:** [March 26, 2019, 2:54pm UTC](https://community.auth0.com/t/users-ip-address-inside-custom-database-login/23101/5 "2019-03-26T14:54:22Z")

</div>

Sounds great @sebastjan.stamatov! Please let us know if we can be of further assistance with any future questions you may have!

---

<div class="post-metadata">

**Author:** ![James.Morrison](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/james.morrison/32/13507_2.png) [@James.Morrison](https://community.auth0.com/u/James.Morrison)\
**Post date:** [April 10, 2019, 2:54pm UTC](https://community.auth0.com/t/users-ip-address-inside-custom-database-login/23101/6 "2019-04-10T14:54:23Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
