How to get full user data in Auth0 using /users API?

Viewed 398

Based on this article, https://auth0.com/docs/api/authentication#get-user-info, I am able get user info. The challenge is, instead of getting full user info, I am getting partial info.

I have "scope": "openid profile email" defined in my JWT. How can I retrieve full info? Am I missing something?

Code:

var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://YOUR_DOMAIN/userinfo',
  'headers': {
    'Authorization': 'Bearer {TOKEN}',
    'Cookie': 'COOKIE'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

Actual Response:

{
    "email": "janedoe@exampleco.com",
    "email_verified": true,
    "name": "Jane Josephine Doe",
    "nickname": "JJ",
    "picture": "http://exampleco.com/janedoe/me.jpg",
    "sub": "248289761001",
    "updated_at": "1556845729"
}

Expected Response:

{
    "address": {
        "country": "us"
    },
    "birthdate": "1972-03-31",
    "email": "janedoe@exampleco.com",
    "email_verified": true,
    "family_name": "Doe",
    "gender": "female",
    "given_name": "Jane",
    "locale": "en-US",
    "middle_name": "Josephine",
    "name": "Jane Josephine Doe",
    "nickname": "JJ",
    "phone_number": "+1 (111) 222-3434",
    "phone_number_verified": false,
    "picture": "http://exampleco.com/janedoe/me.jpg",
    "preferred_username": "j.doe",
    "profile": "http://exampleco.com/janedoe",
    "sub": "248289761001",
    "updated_at": "1556845729",
    "website": "http://exampleco.com",
    "zoneinfo": "America/Los_Angeles"
}
1 Answers

You can create some Action and call them as you will get all user details inside function.

Login to Auth0 >>> leftside-menu-bar >>> Library >> Action

Related