Auth0 Home Blog Docs

Need to Access User Information from Auth0 database after successful authentication


#1

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.


#2

Hello @debarunsengupta2512,

You probably want to use a rule to add the attributes you are interested in to the ID token. You might also be interested in using the Management API directly or via one of the available SDKs such as node-auth0.


#3

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


#4

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:

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);
}

#5

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.


#6

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.


#7

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.


#8

Are you there now to discuss??


#9

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.


#10

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??