Auth0 Home Blog Docs

How to get userinfo from expressjs backend server



I have an app calling my expressJs server where all the auth0 token verification code is.
I am pretty much looking and trying to use the concept defined.

Though the verification succeeds, my next step is to get the user profile info. This is using the access_token and the opaque way of verifying.
I can see on using the following code

app.get('/api/private', checkJwt, checkScopes, function(req, res) { res.json({ message: req.user }); });

req.user prints out the decoded token but it is lacking the userinfo.
How do I know the userinfo at the backend. I would like to store a few properties for a user in the backend and make it available when user logins. What’s the best way?



Hi @er.sharad.kapoor,

You can access the user information in exchange for the access_token using the /getUserInfo endpoint. Please view this for more info.

Additionality, you can get more information on user management here

Hope this helps!