-
-
Save quangthe/40b9fcb7bd52a4fb0d3606a6cd65f7d8 to your computer and use it in GitHub Desktop.
Auth0 Rule for adding app_metadata to JWT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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