How to add user ID to external Database after registering

Hi, I’m new to okta, so please don’t bite :stuck_out_tongue_closed_eyes:
What I’m trying to achieve is after succesful user registration I want to imediately add the registered user id (it’s ‘sub’ filed as I presume) to an external database, in which there will be another data (I don’t want to mix login info with the user data, so the user id would be the only field in common), but I really don’t know where to begin with it.

I’ve implemented this in the open source JHipster project. After the user is logged in, a request is made to /api/authenticate, and that endpoint will save the user’s information in the database. We make sure its read-only and there’s no way for the app to modify the user’s data since it’s just a snapshot. This does allow us to create relationships with the user though, which is nice. You can read more about JHipster in the following blog post.