Capture user_id on New User Registration

Hi - I’ve seen numerous posts on this topic, but none that seem to resolve my issue with my react app / rails API. I’m using the New ULE for user login/signup (React SDK) and api authentication on my rails backend. I’ve followed the quickstart guides and everything is working as expected.

I’d now like to create a User record (only storing Auth0 user_id) on my backend to handle data associations but I can’t seem to figure out how to capture the user_id during the registration process.

I’ve looked into Rules & Hooks, but those only seem to communicate with Auth0 servers, not a webhook endpoint on my end. I could also theoretically check login counts at the callback url every time a user successfully logs in and if new, send an async request to the backend to create a user record but this could be subject to timing issues. I could also host the login UI on my site, but that eliminates the benefits of the ULE.

I’m probably missing something simple here and would appreciate any suggestions - thanks in advance!

Hey @ncarroll, Welcome to the Auth0 Community!

You can access external APIs via the Rule/Hook , you can check the Webhook rule templates in the
Rules section of your tenant for reference. Rules --> Create a new Rule --> Pick a Rule Template --> Webhooks


1 Like

Thanks Sidharth, I knew I was missing something :slight_smile:


Glad you have it working now!

1 Like

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