# Getting the client's IP address inside custom database login

**URL:** <https://community.auth0.com/t/getting-the-clients-ip-address-inside-custom-database-login/20656>\
**Category:** Get Help\
**Tags:** custom-database\
**Created:** [January 29, 2019, 3:52am UTC](https://community.auth0.com/t/getting-the-clients-ip-address-inside-custom-database-login/20656 "2019-01-29T03:52:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![andreaskoepke](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/andreaskoepke/32/10734_2.png) [@andreaskoepke](https://community.auth0.com/u/andreaskoepke)\
**Post date:** [January 29, 2019, 3:52am UTC](https://community.auth0.com/t/getting-the-clients-ip-address-inside-custom-database-login/20656/1 "2019-01-29T03:52:29Z")

</div>

I have looked through the available Node.JS modules but can’t seem to work out if there is a way to obtain the client’s IP address during the login process.

I have seen in Rules we can do this via the context object ([Context Object Properties in Rules - Auth0 Docs](https://auth0.com/docs/rules/references/context-object)) but this is not made available to the login() function.

Has anyone done this before?

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [January 29, 2019, 11:24am UTC](https://community.auth0.com/t/getting-the-clients-ip-address-inside-custom-database-login/20656/2 "2019-01-29T11:24:26Z")

</div>

Hey @andreaskoepke!

I’m not experienced in Node.js and have no idea whether it’s possible to do that with it but as you said you can **obtain user IP address with Rules**.

Important thing to remember is that **Rules are triggered at successful login**

**To obtain the IP address** :

- You need to access context object and its property `request` and then the `ip` property.

I’ll try to find out internally whether it’s doable any other way!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [January 29, 2019, 2:30pm UTC](https://community.auth0.com/t/getting-the-clients-ip-address-inside-custom-database-login/20656/4 "2019-01-29T14:30:07Z")

</div>

Can you provide me with more context around what you plan to do with client’s IP?

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [February 6, 2019, 6:02pm UTC](https://community.auth0.com/t/getting-the-clients-ip-address-inside-custom-database-login/20656/5 "2019-02-06T18:02:17Z")

</div>

Hey there have you had time to see my last message?

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [February 13, 2019, 4:02pm UTC](https://community.auth0.com/t/getting-the-clients-ip-address-inside-custom-database-login/20656/6 "2019-02-13T16:02:23Z")

</div>


