How to get user_metadata and app_metadata in id_token

Hi there @abellamesgen2, we actually have a few sample rules that feed off the user_metadata like the one below. This could be a great reference point when building out new rules. I have also included our rules best practices document at the bottom for historical context. Please let me know if these docs are useful to you or if you could see where we can better adjust them to fit your needs. Thanks in advance!

function(user, context, callback) {

  // copy user metadata value in ID Token
  context.idToken['http://fiz/favorite_color'] = user.user_metadata.favorite_color;

  callback(null, user, context);
}