© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•5mo ago•
4 replies
Damir

Superuser access to Supabase Vault

I am storing my Google 0auth tokens (for connecting Google Drive API to my app) in my Supabase Vault with an aid of an edge function but the last step after giving a consent fails to connect with Google Drive.

And when I investigate my edge function, I discovered this error below:

Failed to store access token: {\n code: "42501",\n details: null,\n hint: null,\n message: "permission denied for function _crypto_aead_det_noncegen"\n}\n"

Brainstorming with Claude, we (I mean Claude) concluded:

Issue: You Don't Have Superuser Permissions
The error means you're not running these commands with sufficient privileges. Vault's internal encryption functions require superuser access to grant permissions, which regular users don't have in Supabase.

How do I enable & grant permission to Supabase Vault for my RPC function?

Ideal architecture should be this:

User → Edge Function (JWT auth)
↓
RPC Function (ownership verification + SECURITY DEFINER)
↓
Vault (encryption)

Anybody has any ideas on how to solve this?

I would like to avoid accessing supabase vault directly via service role like this:

User → Edge Function (JWT auth)
↓
Vault directly (via service_role)
↓
Encryption
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

Grant Vault Access to New Role
SupabaseSSupabase / help-and-questions
13mo ago
Vault Secret & Supabase CLI help
SupabaseSSupabase / help-and-questions
13mo ago
Adding Supabase Vault Secrets extension to local development
SupabaseSSupabase / help-and-questions
4y ago
Supabase general access
SupabaseSSupabase / help-and-questions
4y ago