The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
feat(docs): update admin operation examples to use secret key instead of service_role key (#44854)
fadymakb44c32d05dc1
diff --git a/apps/docs/content/guides/auth/oauth-server/getting-started.mdx b/apps/docs/content/guides/auth/oauth-server/getting-started.mdxindex 84bb123a2c7..d38e5a70105 100644--- a/apps/docs/content/guides/auth/oauth-server/getting-started.mdx+++ b/apps/docs/content/guides/auth/oauth-server/getting-started.mdx@@ -208,7 +208,7 @@ export default async function ConsentPage({const supabase = createServerClient(process.env.NEXT_PUBLIC_SUPABASE_URL!,- process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,+ process.env.NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY!,{cookies: {getAll: async () => (await cookies()).getAll(),@@ -293,7 +293,7 @@ export async function POST(request: Request) {const supabase = createServerClient(process.env.NEXT_PUBLIC_SUPABASE_URL!,- process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,+ process.env.NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY!,{cookies: {getAll: async () => (await cookies()).getAll(),@@ -527,7 +527,7 @@ import { createClient } from '@supabase/supabase-js'const supabase = createClient('https://your-project-id.supabase.co',- 'your-service-role-key' // Use service_role key for admin operations+ 'sb_secret_...' // Use the secret key for admin operations)// Create an OAuth client@@ -557,7 +557,7 @@ from supabase import create_clientsupabase = create_client('https://your-project-id.supabase.co',- 'your-service-role-key' # Use service_role key for admin operations+ 'sb_secret_...' # Use the secret key for admin operations)# Create an OAuth clientdiff --git a/apps/docs/content/guides/auth/oauth-server/mcp-authentication.mdx b/apps/docs/content/guides/auth/oauth-server/mcp-authentication.mdxindex 0838f424b2b..051892f1ad5 100644--- a/apps/docs/content/guides/auth/oauth-server/mcp-authentication.mdx+++ b/apps/docs/content/guides/auth/oauth-server/mcp-authentication.mdx@@ -146,7 +146,7 @@ Always require explicit user approval for MCP clients:- Check RLS policies include the MCP client's `client_id`- Verify user has necessary permissions-- Test with service role key to isolate RLS issues+- Test with secret key to isolate RLS issues- Review [Token Security guide](/docs/guides/auth/oauth-server/token-security)## Next stepsdiff --git a/apps/docs/content/guides/auth/oauth-server/token-security.mdx b/apps/docs/content/guides/auth/oauth-server/token-security.mdxindex e5ca8da24ea..069d6098c1f 100644--- a/apps/docs/content/guides/auth/oauth-server/token-security.mdx+++ b/apps/docs/content/guides/auth/oauth-server/token-security.mdx@@ -384,7 +384,7 @@ Or use the Supabase Dashboard's [RLS policy tester](/dashboard/project/_/auth/po1. Verify the policy includes the client's `client_id`2. Ensure RLS is enabled on the table3. Check for conflicting restrictive policies-4. Test with service role key to isolate RLS issues+4. Test with secret key to isolate RLS issues```sql-- Debug: See what client_id is in the token