Skip to content

Instantly share code, notes, and snippets.

@saltukalakus
Last active June 2, 2025 20:37
Show Gist options
  • Save saltukalakus/ba4119f16d35b715e07ba540bcc74c70 to your computer and use it in GitHub Desktop.
Save saltukalakus/ba4119f16d35b715e07ba540bcc74c70 to your computer and use it in GitHub Desktop.
Delegated admin rule
function (user, context, callback) {
// Set the client ID for the delegated admin extension in the below line if you wish
// and enable the if conditional
//if (context.clientID === 'DELEGATED_ADMIN_EXTENSION_CLIENT_ID') {
console.log("Insert the claim for the delegated admin extension");
const namespace = 'https://example.com/auth0-delegated-admin';
context.idToken[namespace] = { roles: [ 'Delegated Admin - Administrator' ] };
return callback(null, user, context);
//}
callback(null, user, context);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment