# What is the recommended auth flow to store the grant\_id?

**URL:** https://forums.nylas.com/t/what-is-the-recommended-auth-flow-to-store-the-grant-id/262
**Category:** Question and Answers
**Tags:** authentication
**Created:** [July 12, 2024, 1:30pm UTC](https://forums.nylas.com/t/what-is-the-recommended-auth-flow-to-store-the-grant-id/262 "2024-07-12T13:30:27Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![alienator](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@alienator](https://forums.nylas.com/u/alienator)
#### Post date: [July 12, 2024, 1:30pm UTC](https://forums.nylas.com/t/what-is-the-recommended-auth-flow-to-store-the-grant-id/262/1 "2024-07-12T13:30:27Z")

</div>

I am using the Scheduler and Email APIs and will have my users authenticate using Google Sign-in, but I am not sure what would be the best auth flow for this.

Currently I am going for the following:

1. User logs in through Google and provides calendar and email access.
2. Token is provided and we exchange for the grant\_id.
3. Store the grant\_id in the DB
4. Use the stored grant\_id for providing the scheduling interface and using it to send emails.

Is this an okay flow or does the Nylas team recommend a different approach?

---

<div class="post-metadata">

### Author: ![Blag](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.nylas.com/blag/32/9_2.png) [@Blag](https://forums.nylas.com/u/Blag)
#### Post date: [July 12, 2024, 3:13pm UTC](https://forums.nylas.com/t/what-is-the-recommended-auth-flow-to-store-the-grant-id/262/2 "2024-07-12T15:13:50Z")

</div>

Hello @alienator that should be fine, we use the email as the grant\_id so while the grant is valid, you only need the email. Keeping it on the DB is fine as long as your API KEY is secured enough, as you need the combination of both to get access to the email and calendar.

---

<div class="post-metadata">

### Author: ![alienator](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@alienator](https://forums.nylas.com/u/alienator)
#### Post date: [July 12, 2024, 3:45pm UTC](https://forums.nylas.com/t/what-is-the-recommended-auth-flow-to-store-the-grant-id/262/3 "2024-07-12T15:45:14Z")

</div>

Thank you @Blag! I appreciate all the help.
