I’m running an application on AWS where a cronjob fires, retrieves a message from a SQS queue which I then need to retrieve the users Name and Email. I’ve got the users ID but I cant seem to find any working examples of getting the details from Auth0 using the nodejs-auth0 SDK
Which SDK does this apply to? nodejs-auth0
Which verison of the SDK you are using? v2.20.0
Which version of the platform are you facing this error on? NodeJS 10.x
Any help on how I can achieve this or pointing me in the right direction would be greatly appreciated as its driving me nuts now.
If you would like to fetch the user data via a call to the management api, you can do so by calling the getUser function of the node auth0 management client.
This demonstrates a few ways to initialize the management client in the auth0-node library:
And here is an example of getting a user:
auth0.users.get({ id: USER_ID }, function (err, user) {
console.log(user);
});
I’m wondering if there is any more help available as I’ve been at this now for 4 days and is a major blocker for us, because if we can’t retrieve user details in our lambda functions then we’re needing to re think our authentication platform ASAP.
Can you help us with more information? Post your code in full. Have you tried debugging with console logs, what is happening? Are other functions working correctly, or is the whole library not working? Are you getting a valid token?