Store Google (or other social) authenticated users into a custom database?

I need to store custom data with my User accounts such as subscription tier and an API key that I’ll generate. I also need to be able to search for and fetch a User via their API key. Since I need to be able to search on that field it didn’t seem applicable to store it in the Auth0 User app_metadata field since you can only search on “normalized user profile fields”.

Instead I set up a custom Mongo database and connected that to Auth0, now when a user is created they are saved to my MongoDB, I can assign them an API key, and I can search for that User via their API key on my server. This all works great except it only works for email+password users. If they sign up via Google oAuth or social accounts the user is never saved into my database.

Is there a way to force those users to save into my database, or a different approach to storing the API and other extra user data?

1 Like

Hey, I am facing the same issue. Were you able to solve the problem if yes how did you solve it?