# Need to Access User Information from Auth0 database after successful authentication

**URL:** <https://community.auth0.com/t/need-to-access-user-information-from-auth0-database-after-successful-authentication/19964>\
**Category:** Get Help\
**Created:** [January 14, 2019, 2:44pm UTC](https://community.auth0.com/t/need-to-access-user-information-from-auth0-database-after-successful-authentication/19964 "2019-01-14T14:44:03Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![debarunsengupta2512](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/debarunsengupta2512/32/10347_2.png) [@debarunsengupta2512](https://community.auth0.com/u/debarunsengupta2512)\
**Post date:** [January 14, 2019, 2:44pm UTC](https://community.auth0.com/t/need-to-access-user-information-from-auth0-database-after-successful-authentication/19964/1 "2019-01-14T14:44:03Z")

</div>

Hello,

I am implementing google assistant integration with salesforce via node js. I have done the following steps:-

1. Configured Account linking in Google assistant side.
2. Able to successfully authenticate users using salesforce credentials via auth0 and users are getting redirected as well after successful login.

Now I want to fetch the information which have been entered by the user in the authorize page in my node js. Is there any way by which I can access this information from the auth0 database?

Need help on this and appreciate if someone can help me in achieving this.

---

<div class="post-metadata">

**Author:** ![markd](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/markd/32/38919_2.png) [@markd](https://community.auth0.com/u/markd)\
**Post date:** [January 14, 2019, 9:50pm UTC](https://community.auth0.com/t/need-to-access-user-information-from-auth0-database-after-successful-authentication/19964/2 "2019-01-14T21:50:03Z")

</div>

Hello @debarunsengupta2512,

You probably want to use a [rule](https://auth0.com/docs/rules) to add the attributes you are interested in to the [ID token](https://auth0.com/docs/tokens/id-token). You might also be interested in using the [Management API](https://auth0.com/docs/api/management/v2) directly or via one of the available SDKs such as [node-auth0](https://github.com/auth0/node-auth0).

---

<div class="post-metadata">

**Author:** ![debarunsengupta2512](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/debarunsengupta2512/32/10347_2.png) [@debarunsengupta2512](https://community.auth0.com/u/debarunsengupta2512)\
**Post date:** [January 15, 2019, 5:21am UTC](https://community.auth0.com/t/need-to-access-user-information-from-auth0-database-after-successful-authentication/19964/3 "2019-01-15T05:21:28Z")

</div>

do you have any sample code which I can refer to get the user info after successful authentication in node js

---

<div class="post-metadata">

**Author:** ![markd](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/markd/32/38919_2.png) [@markd](https://community.auth0.com/u/markd)\
**Post date:** [January 15, 2019, 5:28am UTC](https://community.auth0.com/t/need-to-access-user-information-from-auth0-database-after-successful-authentication/19964/4 "2019-01-15T05:28:43Z")

</div>

If you are adding a profile attribute to the ID token, you can use the following as a template:

Given an attribute `my_attribute` in the user’s `app_metadata`, add `my_attribute` to the ID token:

```auto
function (user, context, callback) {
  // Adds my_attribute to the idToken
  user.app_metadata = user.app_metadata || {};
  user.app_metadata.my_attribute = user.app_metadata.my_attribute || "";
  context.idToken["https://mydomain.com/claims/my_attribute"] = user.app_metadata.my_attribute;
  callback(null, user, context);
}

```

---

<div class="post-metadata">

**Author:** ![debarunsengupta2512](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/debarunsengupta2512/32/10347_2.png) [@debarunsengupta2512](https://community.auth0.com/u/debarunsengupta2512)\
**Post date:** [January 15, 2019, 5:30am UTC](https://community.auth0.com/t/need-to-access-user-information-from-auth0-database-after-successful-authentication/19964/5 "2019-01-15T05:30:47Z")

</div>

thanks for your prompt response…is there a way I can connect with you via hangout to discuss further on this…got stuck in one area and need help badly to discuss further on the issue.

---

<div class="post-metadata">

**Author:** ![markd](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/markd/32/38919_2.png) [@markd](https://community.auth0.com/u/markd)\
**Post date:** [January 15, 2019, 5:34am UTC](https://community.auth0.com/t/need-to-access-user-information-from-auth0-database-after-successful-authentication/19964/6 "2019-01-15T05:34:09Z")

</div>

I’m afraid its past midnight where I am and I am headed to bed. Feel free to leave details here and I’ll have a look in the morning.

---

<div class="post-metadata">

**Author:** ![debarunsengupta2512](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/debarunsengupta2512/32/10347_2.png) [@debarunsengupta2512](https://community.auth0.com/u/debarunsengupta2512)\
**Post date:** [January 15, 2019, 5:36am UTC](https://community.auth0.com/t/need-to-access-user-information-from-auth0-database-after-successful-authentication/19964/7 "2019-01-15T05:36:36Z")

</div>

my email id is :debarunsengupta2512@gmail.com

you can drop me a request here for hangout discussion.

We can have a call in your morning time as well if it works for you… Please let me know which time works for you.

---

<div class="post-metadata">

**Author:** ![debarunsengupta2512](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/debarunsengupta2512/32/10347_2.png) [@debarunsengupta2512](https://community.auth0.com/u/debarunsengupta2512)\
**Post date:** [January 15, 2019, 8:02pm UTC](https://community.auth0.com/t/need-to-access-user-information-from-auth0-database-after-successful-authentication/19964/8 "2019-01-15T20:02:42Z")

</div>

Are you there now to discuss??

---

<div class="post-metadata">

**Author:** ![markd](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/markd/32/38919_2.png) [@markd](https://community.auth0.com/u/markd)\
**Post date:** [January 16, 2019, 7:26pm UTC](https://community.auth0.com/t/need-to-access-user-information-from-auth0-database-after-successful-authentication/19964/9 "2019-01-16T19:26:43Z")

</div>

Hello @debarunsengupta2512. Apologies for the late reply. I don’t want to mislead you … while I try to help out in the forums as much as I can, I don’t work for Auth0. You might want to try contacting Auth0 support if you don’t resolve your issue in the forums.

---

<div class="post-metadata">

**Author:** ![debarunsengupta2512](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/debarunsengupta2512/32/10347_2.png) [@debarunsengupta2512](https://community.auth0.com/u/debarunsengupta2512)\
**Post date:** [January 16, 2019, 7:29pm UTC](https://community.auth0.com/t/need-to-access-user-information-from-auth0-database-after-successful-authentication/19964/10 "2019-01-16T19:29:12Z")

</div>

I just want to show piece of code and would like to have ur input to fetch the details after successful auth0 authentication…will that be fine fr u??

---

<div class="post-metadata">

**Author:** ![markd](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/markd/32/38919_2.png) [@markd](https://community.auth0.com/u/markd)\
**Post date:** [January 21, 2019, 8:33pm UTC](https://community.auth0.com/t/need-to-access-user-information-from-auth0-database-after-successful-authentication/19964/11 "2019-01-21T20:33:25Z")

</div>

Hello @debarunsengupta2512,

Apologies again for delay. I would be willing to try helping you out, though I should mention I am not a developer and my knowledge of node/javascript is limited (though I am learning!) I’m in the Eastern timezone and could do a video call this evening.

Cheers,  
Mark

---

<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:** [August 29, 2019, 9:11am UTC](https://community.auth0.com/t/need-to-access-user-information-from-auth0-database-after-successful-authentication/19964/12 "2019-08-29T09:11:44Z")

</div>


