External API call in Auth0 Rules

I want to use an external API to check user’s access on an app client by passing some parameters of user metadata and user’s role. I am able to access user’s role and metadata parameters in Auth0 rules but not able to call an external client.

Things I tried:
-Firing Ajax call but couldn’t include jQuery library in rule.
-Using XMLHttpRequest but XMLHttpRequest was not identified.

What should be the process for this?

Hi @Vandit,

Rules are JS functions built on Node. This means JQuery and AJAX aren’t applicable here.

Take a look at this page to see what Node modules are available in rules.

This FAQ shows an example API call to the management API. Although this is another auth0 API, you should be able to take this example and apply it to your scenario.

Hope this helps,

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