Rules app_metadata passwordless universal is empty

I defined a hosted page that has this lock definition :

var lock = new Auth0LockPasswordless(config.clientID, config.auth0Domain, {
auth: {
redirectUrl: config.callbackURL,
responseType: “token id_token”,
params: config.internalOptions,
audience: ‘’,
params: {
scope: ‘openid email profile picture app_metadata user_metadata’

  assetsUrl:  config.assetsUrl,
    allowedConnections: ['email'],
  rememberLastLogin: !prompt,
  language: language,
  languageDictionary: languageDictionary,
  theme: {
    //logo:            'YOUR LOGO HERE',
    //primaryColor:    'green'
  closable: false,
  // uncomment if you want small buttons for social providers
  // socialButtonStyle: 'small'

I tried to define a rule and use a app_metadata but it is empty though it is defined

function (user, context, callback) {
const namespace = ‘’;
console.log("app_metadata: " +user.app_metadata);
console.log("user: " +user);
console.log(“finished logging input”);

var role = ;
role =user.app_metadata.role;

context.idToken[namespace + ‘roles’] = role;
context.idToken[namespace + ‘customUserId’] = user.app_metadata.customUserId;

callback(null, user, context);

User Json:

“phone_number”: “+1508314002”,
“phone_verified”: true,
“name”: “+1508314002”,
“updated_at”: “2018-06-20T12:44:12.524Z”,
“picture”: “”,
“user_id”: “sms|5b20e76e3020501cdsad4e75e66”,
“nickname”: “+972508314002”,
“identities”: [
“user_id”: “5b20e76edssa3020501cd4e75e66”,
“provider”: “sms”,
“connection”: “sms”,
“isSocial”: false
“created_at”: “2018-06-13T09:45:01.171Z”,
“app_metadata”: {
“role”: [
“customUserId”: “1234567890”
“last_ip”: “”,
“last_login”: “2018-06-19T09:27:28.141Z”,
“logins_count”: 5,
“blocked_for”: ,

Hey @davidh !

As it has been more than a few months since this topic was opened and there has been no reply or further information provided from the community as to the existence of the issue we would like to check if you are still facing the described challenge?

We are more than happy to assist in any way! If the issue is still out there please let us know so we can create a new thread for better visibility, otherwise we’ll close this one in week’s time.

Thank you!

This topic was automatically closed after 5 days. New replies are no longer allowed.