- Go to Clients -> Create New -> and choose Non-Interactive to create a non-interactive client.
- Go to APIs -> Auth0 Management API -> Non Interactive Clients
- Authorize the newly created client. Also, check the
update:users
scope and click 'Update'. - Go to Hooks page and create a new post-registration hook with the contents in
post-reg-hook.js
file. Please make sure to change tenant_url in line 4 to your Auth0 domain. - In the hook editor, click on the wrench icon on top-left -> Secrets. Create two new secrets named
client_id
andclient_secret
and add the client ID and secret of the client you created in the first step.
Now, when a user signs up, their app_metadata will include an id
attribute that contains the user_id.