Help converting a rule to an action

I am trying to answer the same question as this commenter: Convert rules to action help

For certain flows I want to map either user.email or user.upn to a custom email claim in the ID token that my app uses in lieu of email in some cases. How do I access user.upn? I have been reading the documentation and it seems like the previous limitation has been removed but I still cannot find a clear way to access the UPN attribute.

function (user, context, callback) {
  const namespace = "https://example.com/"
  context.idToken[namespace + 'email'] = user.email || user.upn;
  callback(null, user, context);
}

Hey there!

As this topic is related to Rules - Hooks - Actions and Rules & Hooks are being deprecated soon I’m excited to let you know about our next Ask me Anything session in the Forum on Thursday, January 18 with the Rules, Hooks and Actions team on Rules & Hooks and why Actions matter! Submit your questions in the thread above and our esteemed product experts will provide written answers on January 18. Find out more about Rules & Hooks and why Actions matter! Can’t wait to see you there!

Learn more here!

Hi @j.montgomery

Welcome to the Auth0 Community!

We’ve updated our Knowledge Solutions with chapter about Adding Claims with Action with a similar fashion to how Rules worked. You can find it here → Azure AD Integration not Providing the User Email

Thanks
Dawid

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