Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save quangthe/40b9fcb7bd52a4fb0d3606a6cd65f7d8 to your computer and use it in GitHub Desktop.
Save quangthe/40b9fcb7bd52a4fb0d3606a6cd65f7d8 to your computer and use it in GitHub Desktop.
Auth0 Rule for adding app_metadata to JWT
function (user, context, callback) {
var namespace = 'https://tojs.io/';
context.accessToken[namespace + 'user_authorization'] = {
groups: user.app_metadata.groups,
roles: user.app_metadata.roles,
permissions: user.app_metadata.permissions
};
return callback(null, user, context);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment