Pipeline Rule and custom Flow Action are not working at legacy API: /oauth/ro

Hi, I need to add some custom attribute to idToken for an old project.
At first I added a rule to achieve it.
My rule function is like this:

function addPersistenceAttribute(user, context, callback) {
  context.idToken['https://example.com/hello'] = 'hello';
  callback(null, user, context);
}

After trying to login by username/password using the legacy api: https://<auth0_domain>/oauth/ro
the idToken I receive then extract jwt, but it does not contain the custom attribute.
But when I try to login by username/password using the new api: https://<auth0_domain>/oauth/token
It works, the idToken contains the custom attribute I added.
One more thing, it happens only when I use the legacy API: password and passwordless login, but for the social login by Google, it works well.

The issue also happens the same with the custom Action in authentication flow.

So anyone can confirm that Rule is working with the legacy API or not? because my project is really old, so I’m not sure about updating it too much

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!