# How to Store Google authenticated users into a custom database?

**URL:** <https://community.auth0.com/t/how-to-store-google-authenticated-users-into-a-custom-database/80189>\
**Category:** Get Help\
**Tags:** api, login, auth0\
**Created:** [March 20, 2022, 12:54pm UTC](https://community.auth0.com/t/how-to-store-google-authenticated-users-into-a-custom-database/80189 "2022-03-20T12:54:48Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [March 23, 2022, 3:57pm UTC](https://community.auth0.com/t/how-to-store-google-authenticated-users-into-a-custom-database/80189/3 "2022-03-23T15:57:28Z")

</div>

Hi @devgiri0082,

There are a few ways to go about this.

- After the user logs in your application receives a set of tokens. Your application will then query your DB for the user in the token and if it doesn’t exist, add the user to the DB.

OR

- Use a [Post Login Action](https://auth0.com/docs/customize/actions/flows-and-triggers/login-flow) to send a request to your backend/DB when a Google user logs in. This will require you to manage some state describing if the user has been added to the database or not. For this, you could [add a flag to the user’s app\_metadata](https://auth0.com/docs/manage-users/user-accounts/metadata/manage-user-metadata) after successfully making the request. You could also use this flow for all of your users if you want consistency.

Let me know if you have any questions.

---

_[View the full topic](https://community.auth0.com/t/how-to-store-google-authenticated-users-into-a-custom-database/80189)._
