Azure SSO Integration - Issue with accessing the email with the Auth0 flows or Actions

The login works with Auth0 SSO Integration perfectly without any issue if no Custom Rules are added.
But if the rule is added, i get " 1. Request to Webtask exceeded allowed execution time" error. I have attached the HAR File as well. Please take a look
Auth0andBlazor.har (3.5 MB)

Hi there @ashokd welcome back!

I imagine this is just due to the fact that you are missing a call to callback, something like the following should do the trick:

function(user, context, callback) {
var namespace = '';
let userId = user.user_id.substring(6,user.user_id.length);

  context.accessToken[namespace + 'user_id'] = userId;
  context.accessToken[namespace + 'email'] =;
  context.accessToken[namespace + 'name'] =;
  callback(null, user, context);

Alternatively, if you like to migrate to an Action, something like the following will work:

exports.onExecutePostLogin = async (event, api) => {

const namespace = '';

let userId = event.user.user_id.substring(6, event.user.user_id.length);

 api.accessToken.setCustomClaim(`${namespace}/user_id`, userId);


Hope this helps!

It worked for the rules section, i can find my user email in the user.upn, but in the actions, i cant find the email. how can i access upn within the actions?

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.