Using custom database and Auth0 properly

Hi

We have an existing app and existing users with multiple front-end and backend apps. The goal is to migrate user management to Auth0.

Here’s my requirements:

  1. There must be a period of supporting both Auth0 and existing backend login APIs.
  2. Users must be able to sign up using Auth0.
  3. Users on our side are identified by a UUID.
  4. Want to avoid storing a mapping or Auth0 auth_id and User uuid on our side.

I followed the migrate users to Auth0 guide, and it works fine until I use custom database. Now, looking forward to #2 in the list above - at some point, we’d want Auth0 to handle user creation and no custom database. At this point, user identifiers would be 12 bytes (which is Auth0’s default), not 16 bytes for an UUID. To support this requirement, I thought I’d use user_metadata field and provision a UUID that’s only used within our apps and is opaque to Auth0. This is where I starting running into problems.

Problem: Custom db create script doesn’t receive user_metadata field, nor can it modify that field. Without receiving user_metadata, I can’t pre-provision a UUID, and without able able to set the field, I can’t provision a UUID within that field. Creation using Management API doesn’t even call custom db script for Get User which would have set the metadata correctly. I would make 2 API calls - one to create user, one to update metadata but that seems wrong.

How do I go about solving this? This doesn’t seem possible so far.

Thank you!