ahammadshaik90
2/15/2019 - 12:35 PM

## Create new custom rule to get user "app_metadata". * Step1: Goto Roles * Step2: Create new custom role and add rule.js code and save i

Create new custom rule to get user "app_metadata".

  • Step1: Goto Roles
  • Step2: Create new custom role and add rule.js code and save it
  • Step3: Open users page and goto any user details page and copy code from app_metadata.js code and page in
{
  "roles": [
    "ROLE_ADMIN"
  ]
}
function (user, context, callback) {
  const namespace = 'https://yourdomainname.com/';
  context.idToken[namespace + 'user_metadata'] = user.user_metadata;
  context.idToken[namespace + 'app_metadata'] = user.app_metadata;
  callback(null, user, context);
}