Skip to content

Instantly share code, notes, and snippets.

@Tanver-Hasan
Created August 24, 2021 11:07
Show Gist options
  • Save Tanver-Hasan/a4c3ee6341c12950c835fc41fe043fc2 to your computer and use it in GitHub Desktop.
Save Tanver-Hasan/a4c3ee6341c12950c835fc41fe043fc2 to your computer and use it in GitHub Desktop.
function (user, context, callback) {
    console.log("executing rule ");
    if (context.clientID === 'ULw7vqL2WK41DIwc2r4QxP78bISpQ2pN') {
       console.log("Adding claim rule ");
        const namespace = 'https://example.com/auth0-delegated-admin';
        context.idToken[namespace] = {
            roles: (context.authorization || {}).roles
        };
    }
    console.log(context.idToken);
    callback(null, user, context);
}
@Tanver-Hasan
Copy link
Author

In the app_metadata, set the following field for department

"Department": "Informantion Management"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment