Auth0 Actions - Pre User Registration Flow


Currently, we are using Auth0 “Resource Owner Password Flow” for the authentication of our users with Auth0. Our backend application (server-side) is using “Auth0 Management API” to communicate with Auth0.

We have a requirement to store user_id from another system as Auth0 user_id and we are able to do that by using Auth0 Management API v2 endpoint by providing “user_id” (The external user’s id provided by the identity provider.) from another system. Also, we are storing the users in the Auth0-hosted database.

We have in plan to switch to another flow (Authorization Code Flow with Proof Key for Code Exchange (PKCE)) and directly communicate with Auth0 from our frontend application. Also, from the backend, we want to remove the usage of “Auth0 Management API” for the registration and login of our users.

While investigating Auth0 Actions and Hooks before migrating to a new flow (pre user registration process) we were not able to find a way to set “user_id” from another application.

Please inform us are we able to set “user_id” during pre user registration process in Actions or Hooks ?

Thank you very much in advance.

Hi @sanjin.o

I don’t think you can do that - set the user ID directly.

Instead, you should create an app_metadata field in your user with the ID you are looking for, and set that. It is independent of the Auth0 user ID, and can be returned in the ID token and access token.

Or you can, in your app, link the Auth0 user ID with a unique user ID in your platform.



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