Saving sub / user_id in another database

Hi here,

Is it a good practice to store the user_id / sub in a external databse?

I want to provide a controlled resouce access to my application. That means a user can only modify the resources that he created.
I thought of saving the sub field of an accesstoken in the stored document that the user created. So, I can check whether the incoming access_token sub field matches with the one stored in the document.

Thank you in advance

Hi @romanreypedrero,

Welcome to the Community!

Yes, you can use the sub claim (the user’s Auth0 user_id), as the unique identifier for the user.

Hope this helps!

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