Created
          March 6, 2018 16:58 
        
      - 
      
- 
        Save philipisapain/c7634232eeb965bea894b17125c0a469 to your computer and use it in GitHub Desktop. 
    Auth0 Rule for adding app_metadata to JWT
  
        
  
    
      This file contains hidden or 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