© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•6mo ago•
11 replies
thor

Storing Google OAuth Tokens

The docs say to securely store tokens:

https://supabase.com/docs/guides/auth/social-login/auth-google?queryGroups=environment&environment=client#saving-google-tokens

but don't explain how.

What's the recommended way of doing this?

So far, sign in w/ supabase auth + google oauth is working well and i can use the tokens to access api functionality but I need to store them else i have to relogin everytime. (This is a next.js project w/ supabase auth and DB btw)

From my understanding and research the two ways to do this securely are through browser in-memory storage or saving encrypted tokens to the database and linking them user. I'm not sure this is correct though.

Are there any docs/examples/guides on how to store these tokens safely and correctly? Would love to know I'm implementing everything as intended and if theres a choice I need to make (and the tradeoffs between them).

Would love to have an official method added to the docs so I know what the suggested best practice way is!
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Best practices for storing Google OAuth tokens with additional scopes
SupabaseSSupabase / help-and-questions
3mo ago
google oauth redirect
SupabaseSSupabase / help-and-questions
4y ago
Google Oauth SSR issue
SupabaseSSupabase / help-and-questions
3mo ago
Supabase Capacitor OAuth Google
SupabaseSSupabase / help-and-questions
10mo ago