The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
feat(docs): add supabase auth oauth2.1 docs (#40340)
Cemal Kılıç93eb6a1c9d13
diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.tsindex fb746a73ba8..83916442815 100644--- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts+++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts@@ -800,6 +800,16 @@ export const auth: NavMenuConstant = {},],},+ {+ name: 'OAuth 2.1 Server',+ items: [+ { name: 'Overview', url: '/guides/auth/oauth-server' },+ { name: 'Getting Started', url: '/guides/auth/oauth-server/getting-started' },+ { name: 'OAuth Flows', url: '/guides/auth/oauth-server/oauth-flows' },+ { name: 'MCP Authentication', url: '/guides/auth/oauth-server/mcp-authentication' },+ { name: 'Token Security & RLS', url: '/guides/auth/oauth-server/token-security' },+ ],+ },{name: 'Third-party auth',enabled: allAuthProvidersEnabled,diff --git a/apps/docs/content/guides/auth/auth-hooks/custom-access-token-hook.mdx b/apps/docs/content/guides/auth/auth-hooks/custom-access-token-hook.mdxindex 4c0af8c9c46..6d93202ef6f 100644--- a/apps/docs/content/guides/auth/auth-hooks/custom-access-token-hook.mdx+++ b/apps/docs/content/guides/auth/auth-hooks/custom-access-token-hook.mdx@@ -16,11 +16,11 @@ Optional Claims: `jti`, `nbf`, `app_metadata`, `user_metadata`, `amr`,**Inputs**-| Field | Type | Description |-| ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |-| `user_id` | `string` | Unique identifier for the user attempting to sign in. |-| `claims` | `object` | Claims which are included in the access token. |-| `authentication_method` | `string` | The authentication method used to request the access token. Possible values include: `oauth`, `password`, `otp`, `totp`, `recovery`, `invite`, `sso/saml`, `magiclink`, `email/signup`, `email_change`, `token_refresh`, `anonymous`. |+| Field | Type | Description |+| ----------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |+| `user_id` | `string` | Unique identifier for the user attempting to sign in. |+| `claims` | `object` | Claims which are included in the access token. |+| `authentication_method` | `string` | The authentication method used to request the access token. Possible values include: `oauth`, `password`, `otp`, `totp`, `recovery`, `invite`, `sso/saml`, `magiclink`, `email/signup`, `email_change`, `token_refresh`, `oauth_provider/authorization_code`, `anonymous`. |<Tabsscrollable@@ -45,7 +45,8 @@ Optional Claims: `jti`, `nbf`, `app_metadata`, `user_metadata`, `amr`,"aal": "aal1","amr": [ { "method": "anonymous", "timestamp": 1715686621 } ],"session_id": "4b938a09-5372-4177-a314-cfa292099ea2",- "is_anonymous": true+ "is_anonymous": true,+ "client_id": "oauth-client-id-if-oauth-flow"},"authentication_method": "anonymous"}@@ -143,6 +144,10 @@ Optional Claims: `jti`, `nbf`, `app_metadata`, `user_metadata`, `amr`,"is_anonymous": {"type": "boolean","x-faker": "random.boolean"+ },+ "client_id": {+ "type": "string",+ "x-faker": "random.uuid"}},"required": [@@ -175,6 +180,7 @@ Optional Claims: `jti`, `nbf`, `app_metadata`, `user_metadata`, `amr`,"email/signup","email_change","token_refresh",+ "oauth_provider/authorization_code","anonymous"]}diff --git a/apps/docs/content/guides/auth/oauth-server.mdx b/apps/docs/content/guides/auth/oauth-server.mdxnew file mode 100644index 00000000000..1dbb75f1279--- /dev/null+++ b/apps/docs/content/guides/auth/oauth-server.mdx@@ -0,0 +1,91 @@+---+title: 'OAuth 2.1 Server'+description: 'Turn your Supabase project into an OAuth 2.1 and OpenID Connect identity provider'+---++Supabase Auth can act as an OAuth 2.1 and OpenID Connect (OIDC) identity provider. This allows other applications and services to use your Supabase project as their authentication provider, just like "Sign in with Google" or "Sign in with GitHub".++You can use this to build "Sign in with [Your App]" experiences, authenticate AI agents through the Model Context Protocol (MCP), power developer platforms with third-party integrations, or implement standards-compliant enterprise SSO.++## Use cases++There are several reasons why you might want to enable OAuth 2.1 Server in your Supabase project:++- **Developer platforms and marketplaces**: Allow third-party developers to build integrations and apps for your platform. Partners can offer "Sign in with [Your App]" to their users, with your control over data access through Row Level Security policies.++- **AI agents and automation**: Authenticate AI agents, LLM tools, and MCP servers that need to access user data. The Model Context Protocol provides automatic OAuth discovery and client registration for AI applications.++- **Mobile and desktop apps**: Issue OAuth tokens to your own mobile apps, desktop applications, or other first-party clients. All tokens respect your existing Row Level Security policies and work with Custom Access Token Hooks.++- **Enterprise SSO**: Provide OpenID Connect (OIDC) authentication for enterprise customers who need standards-compliant identity federation across multiple services.++## Overview++Supabase Auth implements the OAuth 2.1 authorization code flow with PKCE (Proof Key for Code Exchange). When a third-party application wants to access user data:++1. The application redirects the user to your authorization endpoint+2. Supabase Auth validates the request and redirects to your custom authorization UI+3. The user authenticates (using any of your enabled auth methods) and approves access+4. Supabase Auth issues an authorization code+5. The application exchanges the code for access and refresh tokens+6. The application uses the access token to make authenticated API requests++Access tokens are standard Supabase JWTs that include `user_id`, `role`, and `client_id` claims. Your existing Row Level Security policies automatically apply to OAuth tokens, giving you fine-grained control over what each client can access.++### Supported standards++- **OAuth 2.1**: Latest OAuth specification with mandatory PKCE+- **OpenID Connect**: ID tokens (with `openid` scope), UserInfo endpoint, and OIDC discovery+- **Standard scopes**: `openid`, `email`, `profile`, and `phone` scopes for controlling data access+- **Dynamic client registration**: Automatic registration for MCP-compatible clients+- **JWKS endpoint**: Public keys for third parties to validate tokens++### Integration with existing auth++OAuth 2.1 Server works seamlessly with your existing Supabase Auth configuration:++- Users can authenticate using any enabled method (password, magic link, social providers, MFA, phone)+- [Custom Access Token Hooks](/guides/auth/auth-hooks/access-token-hook) apply to OAuth tokens, allowing you to customize claims like `audience` or add client-specific permissions+- Row Level Security policies control data access using the `client_id` claim in tokens+- All standard Supabase features (email templates, hooks, rate limiting) continue to work++## Set up OAuth 2.1 server++To enable OAuth 2.1 Server in your project, follow these guides:++<div className="grid md:grid-cols-12 gap-4 not-prose">+ {[+ {+ name: 'Getting Started',+ description:+ 'Enable OAuth 2.1, configure your authorization endpoint, and register your first client.',+ href: '/guides/auth/oauth-server/getting-started',+ },+ {+ name: 'OAuth Flows',+ description: 'Detailed walkthrough of authorization code and refresh token flows.',+ href: '/guides/auth/oauth-server/oauth-flows',+ },+ {+ name: 'MCP Authentication',+ description: 'Authenticate AI agents and LLM tools using Model Context Protocol.',+ href: '/guides/auth/oauth-server/mcp-authentication',+ },+ {+ name: 'Token Security & RLS',+ description: 'Control data access with Row Level Security policies for OAuth clients.',+ href: '/guides/auth/oauth-server/token-security',+ },+ ].map((x) => (+ <div className="col-span-6" key={x.href}>+ <Link href={x.href} passHref>+ <GlassPanel title={x.name}>{x.description}</GlassPanel>+ </Link>+ </div>+ ))}+</div>++## Resources++- [GitHub Discussion](https://github.com/orgs/supabase/discussions/38022) - Share your use cases and help shape the roadmap+- [Discord Community](https://discord.supabase.com/) - Get help and share what you're buildingdiff --git a/apps/docs/content/guides/auth/oauth-server/getting-started.mdx b/apps/docs/content/guides/auth/oauth-server/getting-started.mdxnew file mode 100644index 00000000000..fbcdbcd1694--- /dev/null+++ b/apps/docs/content/guides/auth/oauth-server/getting-started.mdx@@ -0,0 +1,614 @@+---+id: 'oauth-server-getting-started'+title: 'Getting Started with OAuth 2.1 Server'+description: 'Learn how to enable OAuth 2.1 and register client applications in your Supabase project'+---++This guide will walk you through setting up your Supabase project as an OAuth 2.1 identity provider, from enabling the feature to registering your first client application.++## Prerequisites++Before you begin, make sure you have:++- A Supabase project (create one at [supabase.com](https://supabase.com))+- Admin access to your project+- (Optional) [Supabase CLI](/docs/guides/cli) v2.54.11 or higher for local development++## Overview++Setting up OAuth 2.1 in your Supabase project involves these steps:++1. Enable OAuth 2.1 server capabilities in your project+2. Configure your authorization path+3. Build your authorization UI (frontend)+4. Register OAuth client applications++<Admonition type="note">++Testing OAuth flows is often easier on a Supabase project since it's already accessible on the web, no tunnel or additional configuration needed.++</Admonition>++## Enable OAuth 2.1 server++OAuth 2.1 server is currently in beta and free to use during the beta period on all Supabase plans.++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="dashboard"+ queryGroup="oauth-setup"+>+<TabPanel id="dashboard" label="Cloud">++1. Go to your project dashboard+2. Navigate to **Authentication** > **OAuth Server** in the sidebar+3. Enable OAuth 2.1 server capabilities++</TabPanel>+<TabPanel id="cli" label="CLI">++Edit your `supabase/config.toml` file and add the OAuth server configuration:++```toml+[auth.oauth_server]+enabled = true+authorization_url_path = "/oauth/consent"+allow_dynamic_registration = false # Optional: enable dynamic client registration+```++Start or restart your local Supabase instance:++```bash+supabase start+# or if already running:+supabase stop && supabase start+```++</TabPanel>+</Tabs>++Once enabled, your project will expose the necessary OAuth endpoints:++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="dashboard"+ queryGroup="oauth-setup"+>+<TabPanel id="dashboard" label="Cloud">++| Endpoint | URL |+| -------------------------- | ---------------------------------------------------------------------------------- |+| **Authorization endpoint** | `https://<project-ref>.supabase.co/auth/v1/oauth/authorize` |+| **Token endpoint** | `https://<project-ref>.supabase.co/auth/v1/oauth/token` |+| **JWKS endpoint** | `https://<project-ref>.supabase.co/auth/v1/.well-known/jwks.json` |+| **Discovery endpoint** | `https://<project-ref>.supabase.co/.well-known/oauth-authorization-server/auth/v1` |+| **OIDC discovery** | `https://<project-ref>.supabase.co/auth/v1/.well-known/openid-configuration` |++</TabPanel>+<TabPanel id="cli" label="CLI">++| Endpoint | URL |+| -------------------------- | ----------------------------------------------------------------------- |+| **Authorization endpoint** | `http://localhost:54321/auth/v1/oauth/authorize` |+| **Token endpoint** | `http://localhost:54321/auth/v1/oauth/token` |+| **JWKS endpoint** | `http://localhost:54321/auth/v1/.well-known/jwks.json` |+| **Discovery endpoint** | `http://localhost:54321/.well-known/oauth-authorization-server/auth/v1` |+| **OIDC discovery** | `http://localhost:54321/auth/v1/.well-known/openid-configuration` |++### Expose local instance to the world++To test OAuth flows with external applications, you can expose your local Supabase instance using a tunnel solution (such as [ngrok](https://ngrok.com/) or [Cloudflare Tunnel](https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/)).++When using a tunnel, configure the `jwt_issuer` field in your `supabase/config.toml` to match your tunnel URL:++```toml+[auth]+jwt_issuer = "https://my-tunnel.url/auth/v1"+```++This ensures that JWTs issued by your local instance use the correct issuer claim for token validation, and serves the discovery endpoint at the correct location with accurate discovery information.++</TabPanel>+</Tabs>++<Admonition type="tip">++**Use asymmetric JWT signing keys for better security**++By default, Supabase uses HS256 (symmetric) for signing JWTs. For OAuth use cases, we recommend migrating to asymmetric algorithms like RS256 or ES256. Asymmetric keys are more scalable and secure because:++- OAuth clients can validate JWTs using the public key from your JWKS endpoint+- No need to share your JWT secret with third-party applications+- More resilient architecture for distributed systems++Learn more about [configuring JWT signing keys](/docs/guides/auth/signing-keys).++**Note:** If you plan to use OpenID Connect ID tokens (by requesting the `openid` scope), asymmetric signing algorithms are **required**. ID token generation will fail with HS256.++</Admonition>++## Configure your authorization path++Before registering clients, you need to configure where your authorization UI will live.++1. In your project dashboard, navigate to **Authentication** > **OAuth Server**+2. Set the **Authorization Path** (e.g., `/oauth/consent`)++<Admonition type="note">++The authorization path is combined with your Site URL (configured in **Authentication** > **URL Configuration**) to create the full authorization endpoint URL.++</Admonition>++Your authorization UI will be at the combined Site URL + Authorization Path. For example:++- Site URL: `https://example.com` (from **Authentication** > **URL Configuration**)+- Authorization Path: `/oauth/consent` (from **OAuth Server** settings)+- Your authorization UI: `https://example.com/oauth/consent`++When OAuth clients initiate the authorization flow, Supabase Auth will redirect users to this URL with an `authorization_id` query parameter. You'll use [Supabase JavaScript library OAuth methods](https://github.com/supabase/supabase-js/blob/master/packages/core/auth-js/src/GoTrueClient.ts#L2159-L2163) to handle the authorization:++- `supabase.auth.oauth.getAuthorizationDetails(authorization_id)` - Retrieve client and authorization details+- `supabase.auth.oauth.approveAuthorization(authorization_id)` - Approve the authorization request+- `supabase.auth.oauth.denyAuthorization(authorization_id)` - Deny the authorization request++## Build your authorization UI++This is where you build the **frontend** for your authorization flow. When third-party apps initiate OAuth, users will be redirected to your authorization path (configured in the previous step) with an `authorization_id` query parameter.++Your authorization UI should:++1. **Extract authorization_id** - Get the `authorization_id` from the URL query parameters+2. **Authenticate the user** - If not already logged in, redirect to your login page (preserving the authorization_id)+3. **Retrieve authorization details** - Use `supabase.auth.oauth.getAuthorizationDetails(authorization_id)` to get client information including requested scopes+4. **Display consent screen** - Show the user what app is requesting access and what scopes/permissions are being requested+5. **Handle user decision** - Call either `approveAuthorization(authorization_id)` or `denyAuthorization(authorization_id)` based on user choice++The authorization details include a `scopes` field that contains the scopes requested by the client (e.g., `["openid", "email", "profile"]`). You should display these scopes to the user so they understand what information will be shared.++<Admonition type="note">++This is a **frontend implementation**. You're building the UI that displays the consent screen and handles user interactions. The actual OAuth token generation is handled by Supabase Auth after you call the approve/deny methods.++</Admonition>++### Example authorization UI++Here's how to build a minimal authorization page at your configured path (e.g., `/oauth/consent`):++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="nextjs"+ queryGroup="framework"+>+<TabPanel id="nextjs" label="Next.js">++```tsx+// app/oauth/consent/page.tsx+import { createServerClient } from '@supabase/ssr'+import { cookies } from 'next/headers'+import { redirect } from 'next/navigation'++export default async function ConsentPage({+ searchParams,+}: {+ searchParams: { authorization_id?: string }+}) {+ const authorizationId = searchParams.authorization_id++ if (!authorizationId) {+ return <div>Error: Missing authorization_id</div>+ }++ const supabase = createServerClient(+ process.env.NEXT_PUBLIC_SUPABASE_URL!,+ process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,+ {+ cookies: {+ getAll: async () => (await cookies()).getAll(),+ setAll: async (cookiesToSet) => {+ const cookieStore = await cookies()+ cookiesToSet.forEach(({ name, value, options }) => cookieStore.set(name, value, options))+ },+ },+ }+ )++ // Check if user is authenticated+ const {+ data: { user },+ } = await supabase.auth.getUser()++ if (!user) {+ // Redirect to login, preserving authorization_id+ redirect(`/login?redirect=/oauth/consent?authorization_id=${authorizationId}`)+ }++ // Get authorization details using the authorization_id+ const { data: authDetails, error } =+ await supabase.auth.oauth.getAuthorizationDetails(authorizationId)++ if (error || !authDetails) {+ return <div>Error: {error?.message || 'Invalid authorization request'}</div>+ }++ return (+ <div>+ <h1>Authorize {authDetails.client.name}</h1>+ <p>This application wants to access your account.</p>++ <div>+ <p>+ <strong>Client:</strong> {authDetails.client.name}+ </p>+ <p>+ <strong>Redirect URI:</strong> {authDetails.redirect_uri}+ </p>+ {authDetails.scopes && authDetails.scopes.length > 0 && (+ <div>+ <strong>Requested permissions:</strong>+ <ul>+ {authDetails.scopes.map((scope) => (+ <li key={scope}>{scope}</li>+ ))}+ </ul>+ </div>+ )}+ </div>++ <form action="/api/oauth/decision" method="POST">+ <input type="hidden" name="authorization_id" value={authorizationId} />+ <button type="submit" name="decision" value="approve">+ Approve+ </button>+ <button type="submit" name="decision" value="deny">+ Deny+ </button>+ </form>+ </div>+ )+}+```++```typescript+// app/api/oauth/decision/route.ts+import { createServerClient } from '@supabase/ssr'+import { cookies } from 'next/headers'+import { NextResponse } from 'next/server'++export async function POST(request: Request) {+ const formData = await request.formData()+ const decision = formData.get('decision')+ const authorizationId = formData.get('authorization_id') as string++ if (!authorizationId) {+ return NextResponse.json({ error: 'Missing authorization_id' }, { status: 400 })+ }++ const supabase = createServerClient(+ process.env.NEXT_PUBLIC_SUPABASE_URL!,+ process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,+ {+ cookies: {+ getAll: async () => (await cookies()).getAll(),+ setAll: async (cookiesToSet) => {+ const cookieStore = await cookies()+ cookiesToSet.forEach(({ name, value, options }) => cookieStore.set(name, value, options))+ },+ },+ }+ )++ if (decision === 'approve') {+ const { data, error } = await supabase.auth.oauth.approveAuthorization(authorizationId)++ if (error) {+ return NextResponse.json({ error: error.message }, { status: 400 })+ }++ // Redirect back to the client with authorization code+ return NextResponse.redirect(data.redirect_to)+ } else {+ const { data, error } = await supabase.auth.oauth.denyAuthorization(authorizationId)++ if (error) {+ return NextResponse.json({ error: error.message }, { status: 400 })+ }++ // Redirect back to the client with error+ return NextResponse.redirect(data.redirect_to)+ }+}+```++</TabPanel>+<TabPanel id="react" label="React (SPA)">++```tsx+// src/pages/OAuthConsent.tsx+import { useEffect, useState } from 'react'+import { useNavigate, useSearchParams } from 'react-router-dom'+import { supabase } from './supabaseClient'++export function OAuthConsent() {+ const navigate = useNavigate()+ const [searchParams] = useSearchParams()+ const authorizationId = searchParams.get('authorization_id')++ const [authDetails, setAuthDetails] = useState<any>(null)+ const [loading, setLoading] = useState(true)+ const [error, setError] = useState<string | null>(null)++ useEffect(() => {+ async function loadAuthDetails() {+ if (!authorizationId) {+ setError('Missing authorization_id')+ setLoading(false)+ return+ }++ // Check if user is authenticated+ const {+ data: { user },+ } = await supabase.auth.getUser()++ if (!user) {+ navigate(`/login?redirect=/oauth/consent?authorization_id=${authorizationId}`)+ return+ }++ // Get authorization details using the authorization_id+ const { data, error } = await supabase.auth.oauth.getAuthorizationDetails(authorizationId)++ if (error) {+ setError(error.message)+ } else {+ setAuthDetails(data)+ }++ setLoading(false)+ }++ loadAuthDetails()+ }, [authorizationId, navigate])++ async function handleApprove() {+ if (!authorizationId) return++ const { data, error } = await supabase.auth.oauth.approveAuthorization(authorizationId)++ if (error) {+ setError(error.message)+ } else {+ // Redirect to client app+ window.location.href = data.redirect_to+ }+ }++ async function handleDeny() {+ if (!authorizationId) return++ const { data, error } = await supabase.auth.oauth.denyAuthorization(authorizationId)++ if (error) {+ setError(error.message)+ } else {+ // Redirect to client app with error+ window.location.href = data.redirect_to+ }+ }++ if (loading) return <div>Loading...</div>+ if (error) return <div>Error: {error}</div>+ if (!authDetails) return <div>No authorization request found</div>++ return (+ <div>+ <h1>Authorize {authDetails.client.name}</h1>+ <p>This application wants to access your account.</p>++ <div>+ <p>+ <strong>Client:</strong> {authDetails.client.name}+ </p>+ <p>+ <strong>Redirect URI:</strong> {authDetails.redirect_uri}+ </p>+ {authDetails.scopes && authDetails.scopes.length > 0 && (+ <div>+ <strong>Requested permissions:</strong>+ <ul>+ {authDetails.scopes.map((scope) => (+ <li key={scope}>{scope}</li>+ ))}+ </ul>+ </div>+ )}+ </div>++ <div>+ <button onClick={handleApprove}>Approve</button>+ <button onClick={handleDeny}>Deny</button>+ </div>+ </div>+ )+}+```++</TabPanel>+</Tabs>++### How it works++1. **User navigates to your authorization path** - When a third-party app initiates OAuth, Supabase Auth redirects the user to your configured authorization path (e.g., `https://example.com/oauth/consent?authorization_id=<id>`)+2. **Extract authorization_id** - Your page extracts the `authorization_id` from the URL query parameters+3. **Check authentication** - Your page checks if the user is logged in, redirecting to login if not (preserving the authorization_id)+4. **Retrieve details** - Call `supabase.auth.oauth.getAuthorizationDetails(authorization_id)` to get information about the requesting client+5. **Show consent screen** - Display a UI asking the user to approve or deny access+6. **Handle decision** - When the user clicks approve/deny:+ - Call `supabase.auth.oauth.approveAuthorization(authorization_id)` or `denyAuthorization(authorization_id)`+ - These methods handle all OAuth logic internally (generating authorization codes, etc.)+ - They return a `redirect_to` URL+7. **Redirect back** - Redirect the user to the `redirect_to` URL, which sends them back to the third-party app with either an authorization code (approved) or error (denied)++## Register an OAuth client++Before third-party applications can use your project as an identity provider, you need to register them as OAuth clients.++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="dashboard"+ queryGroup="oauth-setup"+>+<TabPanel id="dashboard" label="Dashboard">++1. Go to **Authentication** > **OAuth Apps** (under the **Manage** section)+2. Click **Add a new client**+3. Enter the client details:+ - **Client name**: A friendly name for your application+ - **Redirect URIs**: One or more URLs where users will be redirected after authorization+ - **Client type**: Choose between:+ - **Public** - For mobile and single-page apps (no client secret)+ - **Confidential** - For server-side apps (includes client secret)+4. Click **Create**++You'll receive:++- **Client ID**: A unique identifier for the client+- **Client Secret** (for confidential clients): A secret key for authenticating the client++<Admonition type="caution">++Store the client secret securely. It will only be shown once. If you lose it, you can regenerate a new one from the **OAuth Apps** page.++</Admonition>++</TabPanel>+<TabPanel id="programmatically" label="Programmatically">++You can register clients programmatically by calling your project's auth server admin endpoint with a secret key:++**Production:**++```bash+curl -X POST 'https://<project-ref>.supabase.co/auth/v1/admin/oauth/clients' \+ -H "Authorization: Bearer ${SUPABASE_SECRET_KEY}" \+ -H "Content-Type: application/json" \+ -d '{+ "name": "My Third-Party App",+ "redirect_uris": [+ "https://my-app.com/auth/callback",+ "https://my-app.com/auth/silent-callback"+ ],+ "client_type": "confidential"+ }'+```++**Local development:**++```bash+curl -X POST 'http://localhost:54321/auth/v1/admin/oauth/clients' \+ -H "Authorization: Bearer ${SUPABASE_SECRET_KEY}" \+ -H "Content-Type: application/json" \+ -d '{+ "name": "Local Dev App",+ "redirect_uris": ["http://localhost:3000/auth/callback"],+ "client_type": "confidential"+ }'+```++Response:++```json+{+ "client_id": "9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d",+ "client_secret": "verysecret-1234567890abcdef...",+ "name": "My Third-Party App",+ "redirect_uris": ["https://my-app.com/auth/callback", "https://my-app.com/auth/silent-callback"],+ "client_type": "confidential",+ "created_at": "2025-01-15T10:30:00.000Z"+}+```++<Admonition type="note">++For complete API documentation, see the [OAuth Admin API reference](/todo).++</Admonition>++### List OAuth clients++To view all registered OAuth clients:++**Production:**++```bash+curl 'https://<project-ref>.supabase.co/auth/v1/admin/oauth/clients' \+ -H "Authorization: Bearer ${SUPABASE_SECRET_KEY}"+```++**Local development:**++```bash+curl 'http://localhost:54321/auth/v1/admin/oauth/clients' \+ -H "Authorization: Bearer ${SUPABASE_SECRET_KEY}"+```++</TabPanel>+</Tabs>++## Customizing tokens (optional)++By default, OAuth access tokens include standard claims like `user_id`, `role`, and `client_id`. If you need to customize tokens—for example, to set a specific `audience` claim for third-party validation or add client-specific metadata—use [Custom Access Token Hooks](/docs/guides/auth/auth-hooks/access-token-hook).++Custom Access Token Hooks are triggered for all token issuance, including OAuth flows. You can use the `client_id` parameter to customize tokens based on which OAuth client is requesting them.++### Common use cases++- **Customize `audience` claim**: Set the `aud` claim to the third-party API endpoint for proper JWT validation+- **Add client-specific permissions**: Include custom claims based on which OAuth client is requesting access+- **Implement dynamic scopes**: Add metadata that RLS policies can use for fine-grained access control++For more examples, see [Token Security & RLS](/docs/guides/auth/oauth-server/token-security#custom-access-token-hooks).++## Redirect URI configuration++Redirect URIs are critical for OAuth security. Supabase Auth will only redirect to URIs that are explicitly registered with the client.++<Admonition type="note">++**Not to be confused with general redirect URLs**++This section is about **OAuth client redirect URIs** - where to send users after they authorize third-party apps to access your Supabase project. This is different from the general [Redirect URLs](/docs/guides/auth/redirect-urls) setting, which controls where to send users after they sign in TO your app using social providers.++</Admonition>++<Admonition type="caution">++**Exact matches only - No wildcards or patterns**++OAuth client redirect URIs require exact, complete URL matches. Unlike general redirect URLs (which support wildcards), OAuth client redirect URIs do NOT support wildcards, patterns, or partial URLs. You must register the full, exact callback URL.++</Admonition>++### Best practices++- **Use HTTPS in production** - Always use HTTPS for redirect URIs in production+- **Register exact, complete URLs** - Each redirect URI must be the full URL including protocol, domain, path, and port if needed+- **Use separate OAuth clients per environment** - Create separate OAuth clients for development, staging, and production. This provides better security isolation, allows independent secret rotation, and improves auditability. If you need to use the same client across environments, you can register multiple redirect URIs, but separate clients are recommended.++## Next steps++Now that you've registered your first OAuth client, you're ready to:++- [Understand OAuth flows](/docs/guides/auth/oauth-server/oauth-flows) - Learn how the authorization code and refresh token flows work+- [Implement MCP authentication](/docs/guides/auth/oauth-server/mcp-authentication) - Enable AI agent authentication+- [Secure with RLS](/docs/guides/auth/oauth-server/token-security) - Control data access for OAuth clientsdiff --git a/apps/docs/content/guides/auth/oauth-server/mcp-authentication.mdx b/apps/docs/content/guides/auth/oauth-server/mcp-authentication.mdxnew file mode 100644index 00000000000..4e5406357f7--- /dev/null+++ b/apps/docs/content/guides/auth/oauth-server/mcp-authentication.mdx@@ -0,0 +1,156 @@+---+id: 'oauth-server-mcp'+title: 'Model Context Protocol (MCP) Authentication'+description: 'Integrate Supabase Auth with MCP servers to authenticate AI agents using your existing user base'+---++The Model Context Protocol (MCP) is an open standard for connecting AI agents and LLM tools to data sources and services. While Supabase doesn't provide MCP server functionality, you can build your own MCP servers that connect to your Supabase project and leverage Supabase Auth's OAuth 2.1 capabilities to authenticate AI agents using your existing user base.++## Why use Supabase Auth for MCP?++When building MCP servers that connect to your Supabase project, you can leverage your existing Supabase Auth infrastructure to authenticate AI agents:++- **Use your existing user base** - No need to create separate authentication systems; AI agents authenticate as your existing users+- **Standards-compliant OAuth 2.1** - Full implementation with PKCE that MCP clients expect+- **Automatic discovery** - MCP clients auto-configure using Supabase's discovery endpoints+- **Dynamic client registration** - MCP clients can register themselves automatically with your project+- **Row Level Security** - Your existing RLS policies automatically apply to MCP clients+- **User authorization** - Users explicitly approve AI agent access through your authorization flow+- **Token management** - Automatic refresh token rotation and expiration handled by Supabase++## How MCP authentication works++When you build an MCP server that connects to your Supabase project, authentication flows through Supabase Auth:++1. **Discovery**: The MCP client fetches your OAuth configuration from Supabase's discovery endpoint+2. **Registration** (optional): The client registers itself as an OAuth client in your Supabase project+3. **Authorization**: User is redirected to your authorization endpoint to approve the AI tool's access+4. **Token exchange**: Supabase issues access and refresh tokens for the authenticated user+5. **Authenticated access**: The MCP server can now make requests to your Supabase APIs on behalf of the user++By leveraging Supabase Auth, your MCP server can authenticate AI agents using your existing user accounts without building a separate authentication system.++## Prerequisites++Before setting up MCP authentication:++- [Enable OAuth 2.1 server](/docs/guides/auth/oauth-server/getting-started) in your Supabase project+- Build an [authorization endpoint](/docs/guides/auth/oauth-server/getting-started#build-your-authorization-endpoint)+- (Optional) Enable dynamic client registration++## Setting up your MCP server++Configure your MCP server to use your Supabase Auth server:++```+https://<project-ref>.supabase.co/auth/v1+```++Replace `<project-ref>` with your project reference ID from the Supabase dashboard.++MCP clients will automatically discover your OAuth configuration from:++```+https://<project-ref>.supabase.co/.well-known/oauth-authorization-server/auth/v1+```++### OAuth client setup++Depending on your MCP server implementation, you have two options:++- **Pre-register an OAuth client** - Manually register your client by following the [Register an OAuth client](/docs/guides/auth/oauth-server/getting-started#register-an-oauth-client) guide and use the client credentials in your MCP server+- **Dynamic client registration** - Enable this in **Authentication** > **OAuth Server** in your Supabase dashboard to allow MCP clients to register themselves automatically without manual intervention++<Admonition type="caution">++Dynamic registration allows any MCP client to register with your project. Consider:++- Requiring user approval for all clients+- Monitoring registered clients regularly+- Validating redirect URIs are from trusted domains++</Admonition>++## Building an MCP server with Supabase Auth++When building your own MCP server, integrate with Supabase Auth to authenticate AI agents as your existing users and leverage your RLS policies.++<Admonition type="tip">++**Looking for an easier way to build MCP servers?**++[FastMCP](https://gofastmcp.com) provides a streamlined way to build MCP servers with built-in Supabase Auth integration. FastMCP handles OAuth configuration, token management, and authentication flows automatically, letting you focus on building your AI agent's functionality. Check out their [Supabase integration guide](https://gofastmcp.com/todo) to get started quickly.++</Admonition>++## Handling MCP tokens in your application++When your MCP server makes requests to your Supabase APIs on behalf of authenticated users, it will send access tokens issued by Supabase Auth, just like any other OAuth client.++### Validating MCP tokens++Use the same token validation as other OAuth clients.++See [Token Security & RLS](/docs/guides/auth/oauth-server/token-security) for more examples.++## Security considerations++### User approval++Always require explicit user approval for MCP clients:++- Show clear information about what the AI agent can access+- Display the client name and description+- List the scopes being requested+- Provide an option to deny access+- Allow users to revoke access later++## Troubleshooting++### MCP client can't discover OAuth configuration++**Problem**: Client shows "OAuth discovery failed" or similar error.++**Solutions**:++- Verify OAuth 2.1 is enabled in your project+- Check that `/.well-known/oauth-authorization-server` returns valid JSON+- Ensure your project URL is accessible++### Dynamic registration fails++**Problem**: Client receives 403 or 404 on registration endpoint.++**Solutions**:++- Enable dynamic client registration in project settings+- Verify redirect URIs are valid, complete URLs (protocol, domain, path, and port)+- Check for rate limiting on registration endpoint++### Token exchange fails++**Problem**: Client receives "invalid_grant" error.++**Solutions**:++- Verify authorization code hasn't expired (10 minutes)+- Ensure code verifier matches code challenge+- Check that redirect URI exactly matches registration+- Confirm client_id is correct++### RLS policies block MCP access++**Problem**: MCP client can't access data despite valid token.++**Solutions**:++- Check RLS policies include the MCP client's `client_id`+- Verify user has necessary permissions+- Test with service role key to isolate RLS issues+- Review [Token Security guide](/docs/guides/auth/oauth-server/token-security)++## Next steps++- [Secure with RLS](/docs/guides/auth/oauth-server/token-security) - Create granular policies for MCP clients+- [OAuth flows](/docs/guides/auth/oauth-server/oauth-flows) - Deep dive into OAuth implementation+- [MCP Specification](https://modelcontextprotocol.io/docs) - Official MCP documentationdiff --git a/apps/docs/content/guides/auth/oauth-server/oauth-flows.mdx b/apps/docs/content/guides/auth/oauth-server/oauth-flows.mdxnew file mode 100644index 00000000000..028634e88c7--- /dev/null+++ b/apps/docs/content/guides/auth/oauth-server/oauth-flows.mdx@@ -0,0 +1,767 @@+---+id: 'oauth-server-flows'+title: 'OAuth 2.1 Flows'+description: 'Understanding the authorization code and refresh token flows with OpenID Connect'+---++Supabase Auth implements OAuth 2.1 with OpenID Connect (OIDC), supporting the authorization code flow with PKCE and refresh token flow. This guide explains how these flows work in detail.++<Admonition type="note">++This guide explains the OAuth 2.1 flows for **third-party client applications** that authenticate with your Supabase project. These flows require custom implementation and are not available in the `@supabase/supabase-js` library. The `supabase-js` library is for authenticating **with** Supabase Auth as an identity provider, not for building your own OAuth server.++</Admonition>++## Supported grant types++Supabase Auth supports two OAuth 2.1 grant types:++1. **Authorization Code with PKCE** (`authorization_code`) - For obtaining initial access tokens+2. **Refresh Token** (`refresh_token`) - For obtaining new access tokens without re-authentication++<Admonition type="note">++Other grant types like `client_credentials` or `password` are not supported.++</Admonition>++## Authorization code flow with PKCE++The authorization code flow with PKCE (Proof Key for Code Exchange) is the recommended flow for all OAuth clients, including single-page applications, mobile apps, and server-side applications.++### How it works++The flow consists of several steps:++1. **Client initiates authorization** - Third-party app redirects user to Supabase Auth's authorize endpoint+2. **Supabase validates and redirects** - Supabase Auth validates OAuth parameters and redirects user to your configured authorization URL+3. **User authenticates and authorizes** - Your frontend checks if user is logged in, shows consent screen, and handles approval/denial+4. **Authorization code issued** - Supabase Auth generates a short-lived authorization code and redirects back to client+5. **Code exchange** - Client exchanges the code for tokens+6. **Access granted** - Client receives access token, refresh token, and ID token++### Flow diagram++Here's a visual representation of the complete authorization code flow:++```+┌─────────────┐ ┌──────────────────┐ ┌──────────────────┐+│ │ │ │ │ │+│ Client │ │ Your Auth UI │ │ Supabase Auth │+│ App │ │ (Frontend) │ │ │+│ │ │ │ │ │+└──────┬──────┘ └────────┬─────────┘ └────────┬─────────┘+ │ │ │+ │ 1. Generate PKCE params │+ │ (code_verifier, code_challenge) │+ │ │ │+ │ 2. Redirect to /oauth/authorize with code_challenge │+ ├────────────────────────────────────────────────────────────────>│+ │ │ │+ │ │ 3. Validate params & redirect │+ │ │ to authorization_path │+ │ │<────────────────────────────────┤+ │ │ │+ │ │ 4. getAuthorizationDetails() │+ │ ├────────────────────────────────>│+ │ │ Return client info │+ │ │<────────────────────────────────┤+ │ │ │+ │ │ 5. User login & consent │+ │ │ │+ │ │ 6. approveAuthorization() │+ │ ├────────────────────────────────>│+ │ │ Return redirect_to with code │+ │ │<────────────────────────────────┤+ │ │ │+ │ 7. Redirect to client callback with code │+ │<───────────────────────────────────────────────────────────────┤+ │ │ │+ │ 8. Exchange code for tokens (POST /oauth/token) │+ │ with code_verifier │+ ├────────────────────────────────────────────────────────────────>│+ │ │ │+ │ 9. Return tokens (access, refresh, ID) │+ │<────────────────────────────────────────────────────────────────┤+ │ │ │+ │ 10. Access resources with access_token │+ │ │ │+ │ 11. Refresh tokens (POST /oauth/token with refresh_token) │+ ├────────────────────────────────────────────────────────────────>│+ │ │ │+ │ 12. Return new tokens │+ │<────────────────────────────────────────────────────────────────┤+ │ │ │+```++**Key points:**++- Third-party client redirects user to **Supabase Auth's authorize endpoint** (not directly to your UI)+- Supabase Auth validates OAuth parameters and redirects to **your authorization path**+- Your frontend UI handles authentication and consent using `supabase-js` OAuth methods+- Supabase Auth handles all backend OAuth logic (code generation, token issuance)++### Step 1: Generate PKCE parameters++Before initiating the flow, the client must generate PKCE parameters:++```javascript+// Generate a random code verifier (43-128 characters)+function generateCodeVerifier() {+ const array = new Uint8Array(32)+ crypto.getRandomValues(array)+ return base64URLEncode(array)+}++// Create code challenge from verifier+async function generateCodeChallenge(verifier) {+ const encoder = new TextEncoder()+ const data = encoder.encode(verifier)+ const hash = await crypto.subtle.digest('SHA-256', data)+ return base64URLEncode(new Uint8Array(hash))+}++function base64URLEncode(buffer) {+ return btoa(String.fromCharCode(...buffer))+ .replace(/\+/g, '-')+ .replace(/\//g, '_')+ .replace(/=/g, '')+}++// Generate and store verifier (you'll need it later)+const codeVerifier = generateCodeVerifier()+sessionStorage.setItem('code_verifier', codeVerifier)++// Generate challenge to send in authorization request+const codeChallenge = await generateCodeChallenge(codeVerifier)+```++### Step 2: Authorization request++The client redirects the user to your authorization endpoint with the following parameters:++```+https://<project-ref>.supabase.co/auth/v1/oauth/authorize?+ response_type=code+ &client_id=<client-id>+ &redirect_uri=<configured-redirect-uri>+ &state=<random-state>+ &code_challenge=<code-challenge>+ &code_challenge_method=S256+```++#### Required parameters++| Parameter | Description |+| ----------------------- | -------------------------------------------- |+| `response_type` | Must be `code` for authorization code flow |+| `client_id` | The client ID from registration |+| `redirect_uri` | Must exactly match a registered redirect URI |+| `code_challenge` | The generated code challenge |+| `code_challenge_method` | Must be `S256` (SHA-256) |++#### Optional parameters++| Parameter | Description |+| --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |+| `state` | Random string to prevent CSRF attacks (highly recommended) |+| `scope` | Space-separated list of scopes (e.g., `openid email profile phone`). Requested scopes will be included in the access token and control what information is returned by the UserInfo endpoint. Default scope when none provided is `email`. If the `openid` scope is requested, an ID token will be included in the response. |+| `nonce` | Random string for replay attack protection. If provided, will be included in the ID token. |++<Admonition type="caution">++Always include a `state` parameter to protect against CSRF attacks. Generate a random string, store it in session storage, and verify it matches when the user returns.++</Admonition>++### Step 3: User authentication and consent++After receiving the authorization request, Supabase Auth validates the OAuth parameters (client_id, redirect_uri, PKCE, etc.) and then redirects the user to your configured **authorization path** (e.g., `https://example.com/oauth/consent?authorization_id=<id>`).++The URL will contain an `authorization_id` query parameter that identifies this authorization request.++Your frontend application at the authorization path should:++1. **Extract authorization_id** - Get the `authorization_id` from the URL query parameters+2. **Fetch authorization details** - Call `supabase.auth.oauth.getAuthorizationDetails(authorization_id)` to retrieve information about the OAuth client and request parameters+3. **Check user authentication** - Verify if the user is logged in; if not, redirect to your login page (preserving the full authorization path including the `authorization_id`). After successful login, redirect the user back to the authorization path with the same `authorization_id` query parameter+4. **Display consent screen** - Show the user information about the requesting client (name, redirect URI, scopes)+5. **Handle user decision** - When the user approves or denies:+ - Call `supabase.auth.oauth.approveAuthorization(authorization_id)` to approve+ - Call `supabase.auth.oauth.denyAuthorization(authorization_id)` to deny+ - Redirect user to the returned `redirect_to` URL++This is a **frontend implementation** using `supabase-js`. Supabase Auth handles all the backend OAuth logic (generating authorization codes, validating requests, etc.) after you call the approve/deny methods.++See the [Getting Started guide](/docs/guides/auth/oauth-server/getting-started#example-authorization-ui) for complete implementation examples.++### Step 4: Authorization code issued++If the user approves access, Supabase Auth redirects back to the client's redirect URI with an authorization code:++```+https://client-app.com/callback?+ code=<authorization-code>+ &state=<state-from-request>+```++The authorization code is:++- **Short-lived** - Valid for 10 minutes+- **Single-use** - Can only be exchanged once+- **Bound to PKCE** - Can only be exchanged with the correct code verifier++If the user denies access, Supabase Auth redirects with error information in query parameters:++```+https://client-app.com/callback?+ error=access_denied+ &error_description=The+user+denied+the+authorization+request+ &state=<state-from-request>+```++The error parameters allow clients to display relevant error messages to users:++| Parameter | Description |+| ------------------- | --------------------------------------------------------------------- |+| `error` | Error code (e.g., `access_denied`, `invalid_request`, `server_error`) |+| `error_description` | Human-readable error description explaining what went wrong |+| `state` | The state parameter from the original request (for CSRF protection) |++### Step 5: Token exchange++The client exchanges the authorization code for tokens by making a POST request to the token endpoint:++```bash+curl -X POST 'https://<project-ref>.supabase.co/auth/v1/oauth/token' \+ -H 'Content-Type: application/x-www-form-urlencoded' \+ -d 'grant_type=authorization_code' \+ -d 'code=<authorization-code>' \+ -d 'client_id=<client-id>' \+ -d 'redirect_uri=<redirect-uri>' \+ -d 'code_verifier=<code-verifier>'+```++For confidential clients (with client secret):++```bash+curl -X POST 'https://<project-ref>.supabase.co/auth/v1/oauth/token' \+ -H 'Content-Type: application/x-www-form-urlencoded' \+ -d 'grant_type=authorization_code' \+ -d 'code=<authorization-code>' \+ -d 'client_id=<client-id>' \+ -d 'client_secret=<client-secret>' \+ -d 'redirect_uri=<redirect-uri>' \+ -d 'code_verifier=<code-verifier>'+```++#### Example in JavaScript++```javascript+// Retrieve the code verifier from storage+const codeVerifier = sessionStorage.getItem('code_verifier')++// Exchange code for tokens+const response = await fetch(`https://<project-ref>.supabase.co/auth/v1/oauth/token`, {+ method: 'POST',+ headers: {+ 'Content-Type': 'application/x-www-form-urlencoded',+ },+ body: new URLSearchParams({+ grant_type: 'authorization_code',+ code: authorizationCode,+ client_id: '<client-id>',+ redirect_uri: '<redirect-uri>',+ code_verifier: codeVerifier,+ }),+})++const tokens = await response.json()+```++### Step 6: Token response++On success, Supabase Auth returns a JSON response with tokens:++```json+{+ "access_token": "eyJhbGc...",+ "token_type": "bearer",+ "expires_in": 3600,+ "refresh_token": "MXff...",+ "scope": "openid email profile",+ "id_token": "eyJhbGc..."+}+```++| Field | Description |+| --------------- | ---------------------------------------------------------------------------------------------------- |+| `access_token` | JWT access token for accessing resources |+| `token_type` | Always `bearer` |+| `expires_in` | Token lifetime in seconds (default: 3600) |+| `refresh_token` | Token for obtaining new access tokens |+| `scope` | Granted scopes from the authorization request |+| `id_token` | OpenID Connect ID token (included only if `openid` scope was requested in the authorization request) |++## Access token structure++Access tokens are JWTs containing standard Supabase claims plus OAuth-specific claims:++```json+{+ "aud": "authenticated",+ "exp": 1735819200,+ "iat": 1735815600,+ "iss": "https://<project-ref>.supabase.co/auth/v1",+ "sub": "user-uuid",+ "email": "[email protected]",+ "phone": "",+ "app_metadata": {+ "provider": "email",+ "providers": ["email"]+ },+ "user_metadata": {},+ "role": "authenticated",+ "aal": "aal1",+ "amr": [+ {+ "method": "password",+ "timestamp": 1735815600+ }+ ],+ "session_id": "session-uuid",+ "client_id": "9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d"+}+```++### OAuth-specific claims++| Claim | Description |+| ----------- | -------------------------------------------- |+| `client_id` | The OAuth client ID that obtained this token |++All other claims follow the standard [Supabase JWT structure](/docs/guides/auth/jwts).++### Available scopes++The following scopes are currently supported:++| Scope | Description |+| --------- | ------------------------------------------------------------------------------------- |+| `openid` | Enables OpenID Connect. When requested, an ID token will be included in the response. |+| `email` | Grants access to email and email_verified claims |+| `profile` | Grants access to profile information (name, picture, etc.) |+| `phone` | Grants access to phone_number and phone_number_verified claims |++**Default scope:** When no scope is specified in the authorization request, the default scope is `email`.++Scopes affect what information is included in ID tokens and returned by the UserInfo endpoint. All OAuth access tokens have full access to user data (same as regular session tokens), with the addition of the `client_id` claim. Use Row Level Security policies with the `client_id` claim to control which data each OAuth client can access.++<Admonition type="note">++**Custom scopes are not currently supported.** Only the standard scopes listed above are available. Support for custom scopes is planned for a future release, which will allow you to define application-specific permissions and fine-grained access control.++</Admonition>++## Refresh token flow++Refresh tokens allow clients to obtain new access tokens without requiring the user to re-authenticate.++### When to refresh++Clients should refresh access tokens when:++- The access token is expired (check the `exp` claim)+- The access token is about to expire (proactive refresh)+- An API call returns a 401 Unauthorized error++### Refresh request++Make a POST request to the token endpoint with the refresh token:++```bash+curl -X POST 'https://<project-ref>.supabase.co/auth/v1/oauth/token' \+ -H 'Content-Type: application/x-www-form-urlencoded' \+ -d 'grant_type=refresh_token' \+ -d 'refresh_token=<refresh-token>' \+ -d 'client_id=<client-id>'+```++For confidential clients:++```bash+curl -X POST 'https://<project-ref>.supabase.co/auth/v1/oauth/token' \+ -H 'Content-Type: application/x-www-form-urlencoded' \+ -d 'grant_type=refresh_token' \+ -d 'refresh_token=<refresh-token>' \+ -d 'client_id=<client-id>' \+ -d 'client_secret=<client-secret>'+```++#### Example in JavaScript++```javascript+async function refreshAccessToken(refreshToken) {+ const response = await fetch(`https://<project-ref>.supabase.co/auth/v1/oauth/token`, {+ method: 'POST',+ headers: {+ 'Content-Type': 'application/x-www-form-urlencoded',+ },+ body: new URLSearchParams({+ grant_type: 'refresh_token',+ refresh_token: refreshToken,+ client_id: '<client-id>',+ }),+ })++ if (!response.ok) {+ throw new Error('Failed to refresh token')+ }++ return await response.json()+}+```++### Refresh response++The response contains a new access token and optionally a new refresh token:++```json+{+ "access_token": "eyJhbGc...",+ "token_type": "bearer",+ "expires_in": 3600,+ "refresh_token": "v1.MXff...",+ "scope": "openid email profile"+}+```++<Admonition type="note">++Refresh tokens may be rotated (a new refresh token is issued). Always update your stored refresh token when a new one is provided.++</Admonition>++## OpenID Connect (OIDC)++Supabase Auth supports OpenID Connect, an identity layer on top of OAuth 2.1.++<Admonition type="note">++**ID tokens are only included when the `openid` scope is requested.** To receive an ID token, include `openid` in the space-separated list of scopes in your authorization request. ID tokens are valid for 1 hour.++</Admonition>++### ID tokens++ID tokens are JWTs that contain user identity information. They are signed by Supabase Auth and can be verified by clients.++The claims included in the ID token depend on the scopes requested during authorization. For example, requesting `openid email profile` will include email and profile-related claims, while requesting only `openid email` will include only email-related claims.++#### Example ID token++```json+{+ "iss": "https://<project-ref>.supabase.co/auth/v1",+ "sub": "user-uuid",+ "aud": "client-id",+ "exp": 1735819200,+ "iat": 1735815600,+ "auth_time": 1735815600,+ "nonce": "random-nonce-from-request",+ "email": "[email protected]",+ "email_verified": true,+ "phone_number": "+1234567890",+ "phone_number_verified": false,+ "name": "John Doe",+ "picture": "https://example.com/avatar.jpg"+}+```++#### Standard OIDC claims++| Claim | Description |+| ----------------------- | ------------------------------------------------------------ |+| `sub` | Subject (user ID) |+| `nonce` | The nonce value from the authorization request (if provided) |+| `email` | User's email address |+| `email_verified` | Whether the email is verified |+| `phone_number` | User's phone number |+| `phone_number_verified` | Whether the phone is verified |+| `name` | User's full name |+| `picture` | User's profile picture URL |++### UserInfo endpoint++Clients can retrieve user information by calling the UserInfo endpoint with an access token:++```bash+curl 'https://<project-ref>.supabase.co/auth/v1/oauth/userinfo' \+ -H 'Authorization: Bearer <access-token>'+```++The information returned depends on the scopes granted in the access token. For example:++**With `email` scope:**++```json+{+ "sub": "user-uuid",+ "email": "[email protected]",+ "email_verified": true+}+```++**With `email profile phone` scopes:**++```json+{+ "sub": "user-uuid",+ "email": "[email protected]",+ "email_verified": true,+ "phone_number": "+1234567890",+ "phone_number_verified": false,+ "name": "John Doe",+ "picture": "https://example.com/avatar.jpg"+}+```++### OIDC discovery++Supabase Auth exposes OpenID Connect and OAuth 2.1 discovery endpoints that describe its capabilities:++```+https://<project-ref>.supabase.co/auth/v1/.well-known/openid-configuration+https://<project-ref>.supabase.co/auth/v1/.well-known/oauth-authorization-server+```++<Admonition type="note">++Both endpoints return the same metadata and can be used interchangeably. They are provided for compatibility with different OAuth and OIDC clients that may expect one or the other.++</Admonition>++These endpoints return metadata about:++- Available endpoints (authorization, token, userinfo, JWKS)+- Supported grant types and response types+- Supported scopes and claims+- Token signing algorithms++This enables automatic integration with OIDC-compliant libraries and tools.++## Token validation++Third-party clients should validate access tokens to ensure they're authentic and not tampered with.++<Admonition type="tip">++**Recommended: Use asymmetric JWT signing keys**++For OAuth implementations, we strongly recommend using asymmetric signing algorithms (RS256 or ES256) instead of the default HS256. With asymmetric keys, third-party clients can validate JWTs using the public key from your JWKS endpoint without needing access to your JWT secret. This is more secure, scalable, and follows OAuth best practices.++Learn how to [configure asymmetric JWT signing keys](/docs/guides/auth/signing-keys) in your project.++</Admonition>++<Admonition type="caution">++**ID tokens require asymmetric signing algorithms**++If you request the `openid` scope to receive ID tokens, your project must be configured to use asymmetric signing algorithms (RS256 or ES256). ID token generation will fail with an error if your project is still using the default HS256 symmetric algorithm. This is a security requirement of the OpenID Connect specification.++</Admonition>++### JWKS endpoint++Supabase Auth exposes a JSON Web Key Set (JWKS) endpoint containing public keys for token verification:++```+https://<project-ref>.supabase.co/auth/v1/.well-known/jwks.json+```++Example response:++```json+{+ "keys": [+ {+ "kty": "RSA",+ "kid": "key-id",+ "use": "sig",+ "alg": "RS256",+ "n": "...",+ "e": "AQAB"+ }+ ]+}+```++### Validating tokens++Use a JWT library to verify tokens:++<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="node"+ queryGroup="language"+>+<TabPanel id="node" label="Node.js">++```javascript+import { createRemoteJWKSet, jwtVerify } from 'jose'++const JWKS = createRemoteJWKSet(+ new URL('https://<project-ref>.supabase.co/auth/v1/.well-known/jwks.json')+)++async function verifyAccessToken(token) {+ try {+ const { payload } = await jwtVerify(token, JWKS, {+ issuer: 'https://<project-ref>.supabase.co/auth/v1',+ audience: 'authenticated',+ })+ return payload+ } catch (error) {+ console.error('Token verification failed:', error)+ return null+ }+}+```++</TabPanel>+<TabPanel id="python" label="Python">++```python+from jose import jwt+from jose.backends import RSAKey+import requests++# Fetch JWKS+jwks = requests.get('https://<project-ref>.supabase.co/auth/v1/.well-known/jwks.json').json()++def verify_access_token(token):+ try:+ payload = jwt.decode(+ token,+ jwks,+ algorithms=['RS256'],+ issuer='https://<project-ref>.supabase.co/auth/v1',+ audience='authenticated'+ )+ return payload+ except jwt.JWTError as e:+ print(f'Token verification failed: {e}')+ return None+```++</TabPanel>+<TabPanel id="go" label="Go">++```go+package main++import (+ "context"+ "github.com/coreos/go-oidc/v3/oidc"+)++func verifyAccessToken(ctx context.Context, token string) (*oidc.IDToken, error) {+ provider, err := oidc.NewProvider(+ ctx,+ "https://<project-ref>.supabase.co/auth/v1",+ )+ if err != nil {+ return nil, err+ }++ verifier := provider.Verifier(&oidc.Config{+ ClientID: "authenticated",+ })++ return verifier.Verify(ctx, token)+}+```++</TabPanel>+</Tabs>++### What to validate++Always verify:++1. **Signature** - Token is signed by Supabase Auth+2. **Issuer** (`iss`) - Matches your project URL+3. **Audience** (`aud`) - Is `authenticated`+4. **Expiration** (`exp`) - Token is not expired+5. **Client ID** (`client_id`) - Matches your client (if applicable)++## Managing user grants++Users can view and manage the OAuth applications they've authorized to access their account. This is important for transparency and security, allowing users to audit and revoke access when needed.++### Viewing authorized applications++Users can retrieve a list of all OAuth clients they've authorized:++```javascript+const { data: grants, error } = await supabase.auth.oauth.getUserGrants()++if (error) {+ console.error('Error fetching grants:', error)+} else {+ console.log('Authorized applications:', grants)+}+```++The response includes details about each authorized OAuth client:++```json+[+ {+ "id": "grant-uuid",+ "client_id": "9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d",+ "client_name": "My Third-Party App",+ "scopes": ["email", "profile"],+ "created_at": "2025-01-15T10:30:00.000Z",+ "updated_at": "2025-01-15T10:30:00.000Z"+ }+]+```++### Revoking access++Users can revoke access for a specific OAuth client at any time. When access is revoked, all active sessions and refresh tokens for that client are immediately invalidated:++```javascript+const { error } = await supabase.auth.oauth.revokeGrant(clientId)++if (error) {+ console.error('Error revoking access:', error)+} else {+ console.log('Access revoked successfully')+}+```++After revoking access:++- All refresh tokens for that client are deleted+- The user will need to re-authorize the application to grant access again++<Admonition type="tip">++**Build a settings page for your users**++It's a good practice to provide a settings page where users can view all authorized applications and revoke access to any they no longer trust or use. This increases transparency and gives users control over their data.++</Admonition>++For complete API reference, see the [OAuth methods in supabase-js](/docs/reference/javascript/auth-oauth).++## Next steps++- [Implement MCP authentication](/docs/guides/auth/oauth-server/mcp-authentication) - Enable AI agent authentication+- [Secure with RLS](/docs/guides/auth/oauth-server/token-security) - Control data access for OAuth clients+- [Learn about JWTs](/docs/guides/auth/jwts) - Understand Supabase token structurediff --git a/apps/docs/content/guides/auth/oauth-server/token-security.mdx b/apps/docs/content/guides/auth/oauth-server/token-security.mdxnew file mode 100644index 00000000000..e5ca8da24ea--- /dev/null+++ b/apps/docs/content/guides/auth/oauth-server/token-security.mdx@@ -0,0 +1,446 @@+---+id: 'oauth-server-token-security'+title: 'Token Security and Row Level Security'+description: 'Secure your data with Row Level Security policies for OAuth clients'+---++When you enable OAuth 2.1 in your Supabase project, third-party applications can access user data on their behalf. Row Level Security (RLS) policies are crucial for controlling exactly what data each OAuth client can access.++<Admonition type="caution">++**Scopes control OIDC data, not database access**++The OAuth scopes (`openid`, `email`, `profile`, `phone`) control what user information is included in ID tokens and returned by the UserInfo endpoint. They do **not** control access to your database tables or API endpoints.++Use RLS to define which OAuth clients can access which data, regardless of the scopes they requested.++</Admonition>++## How OAuth tokens work with RLS++OAuth access tokens issued by Supabase Auth are JWTs that include all standard Supabase claims plus OAuth-specific claims. This means your existing RLS policies continue to work, and you can add OAuth-specific logic to create granular access controls.++### Token structure++Every OAuth access token includes:++```json+{+ "sub": "user-uuid",+ "role": "authenticated",+ "aud": "authenticated",+ "user_id": "user-uuid",+ "email": "[email protected]",+ "client_id": "9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d",+ "aal": "aal1",+ "amr": [{ "method": "password", "timestamp": 1735815600 }],+ "session_id": "session-uuid",+ "iss": "https://<project-ref>.supabase.co/auth/v1",+ "iat": 1735815600,+ "exp": 1735819200+}+```++The key OAuth-specific claim is:++| Claim | Description |+| ----------- | -------------------------------------------------------------- |+| `client_id` | Unique identifier of the OAuth client that obtained this token |++You can use this claim in RLS policies to grant different permissions to different clients.++## Extracting OAuth claims in RLS++Use the `auth.jwt()` function to access token claims in your policies:++```sql+-- Get the client ID from the token+(auth.jwt() ->> 'client_id')++-- Check if the token is from an OAuth client+(auth.jwt() ->> 'client_id') IS NOT NULL++-- Check if the token is from a specific client+(auth.jwt() ->> 'client_id') = 'mobile-app-client-id'+```++## Common RLS patterns for OAuth++### Pattern 1: Grant specific client full access++Allow a specific OAuth client to access all user data:++```sql+CREATE POLICY "Mobile app can access user data"+ON user_data FOR ALL+USING (+ auth.uid() = user_id AND+ (auth.jwt() ->> 'client_id') = 'mobile-app-client-id'+);+```++### Pattern 2: Grant multiple clients read-only access++Allow several OAuth clients to read data, but not modify it:++```sql+CREATE POLICY "Third-party apps can read profiles"+ON profiles FOR SELECT+USING (+ auth.uid() = user_id AND+ (auth.jwt() ->> 'client_id') IN (+ 'analytics-client-id',+ 'reporting-client-id',+ 'dashboard-client-id'+ )+);+```++### Pattern 3: Restrict sensitive data from OAuth clients++Prevent OAuth clients from accessing sensitive data:++```sql+CREATE POLICY "OAuth clients cannot access payment info"+ON payment_methods FOR ALL+USING (+ auth.uid() = user_id AND+ (auth.jwt() ->> 'client_id') IS NULL -- Only direct user sessions+);+```++### Pattern 4: Client-specific data access++Different clients access different subsets of data:++```sql+-- Analytics client can only read aggregated data+CREATE POLICY "Analytics client reads summaries"+ON user_metrics FOR SELECT+USING (+ auth.uid() = user_id AND+ (auth.jwt() ->> 'client_id') = 'analytics-client-id'+);++-- Admin client can read and modify all data+CREATE POLICY "Admin client full access"+ON user_data FOR ALL+USING (+ auth.uid() = user_id AND+ (auth.jwt() ->> 'client_id') = 'admin-client-id'+);+```++## Real-world examples++### Example 1: Multi-platform application++You have a web app, mobile app, and third-party integrations:++```sql+-- Web app: Full access+CREATE POLICY "Web app full access"+ON profiles FOR ALL+USING (+ auth.uid() = user_id AND+ (+ (auth.jwt() ->> 'client_id') = 'web-app-client-id'+ OR (auth.jwt() ->> 'client_id') IS NULL -- Direct user sessions+ )+);++-- Mobile app: Read-only access to profiles+CREATE POLICY "Mobile app reads profiles"+ON profiles FOR SELECT+USING (+ auth.uid() = user_id AND+ (auth.jwt() ->> 'client_id') = 'mobile-app-client-id'+);++-- Third-party integration: Limited data access+CREATE POLICY "Integration reads public data"+ON profiles FOR SELECT+USING (+ auth.uid() = user_id AND+ (auth.jwt() ->> 'client_id') = 'integration-client-id' AND+ is_public = true+);+```++## Custom access token hooks++[Custom Access Token Hooks](/docs/guides/auth/auth-hooks/custom-access-token-hook) work with OAuth tokens, allowing you to inject custom claims based on the OAuth client. This is particularly useful for customizing standard JWT claims like `audience` (`aud`) or adding client-specific metadata.++<Admonition type="note">++Custom Access Token Hooks are triggered for **all** token issuance. Use `client_id` or `authentication_method` (`oauth_provider/authorization_code` for OAuth flows) to differentiate OAuth from regular authentication.++</Admonition>++### Customizing the audience claim++A common use case is customizing the `audience` claim for different OAuth clients. This allows third-party services to validate that tokens were issued specifically for them:++```typescript+import { serve } from 'https://deno.land/[email protected]/http/server.ts'++serve(async (req) => {+ const { user, claims, client_id } = await req.json()++ // Customize audience based on OAuth client+ if (client_id === 'mobile-app-client-id') {+ return new Response(+ JSON.stringify({+ claims: {+ aud: 'https://api.myapp.com',+ app_version: '2.0.0',+ },+ }),+ { headers: { 'Content-Type': 'application/json' } }+ )+ }++ if (client_id === 'analytics-partner-id') {+ return new Response(+ JSON.stringify({+ claims: {+ aud: 'https://analytics.partner.com',+ access_level: 'read-only',+ },+ }),+ { headers: { 'Content-Type': 'application/json' } }+ )+ }++ // Default audience for non-OAuth flows+ return new Response(JSON.stringify({ claims: {} }), {+ headers: { 'Content-Type': 'application/json' },+ })+})+```++The `audience` claim is especially important for:++- **JWT validation by third parties**: Services can verify tokens were issued for their specific API+- **Multi-tenant applications**: Different audiences for different client applications+- **Compliance**: Meeting security requirements that mandate audience validation++### Adding client-specific claims++You can also add custom claims and metadata based on the OAuth client:++```typescript+import { serve } from 'https://deno.land/[email protected]/http/server.ts'+import { createClient } from 'https://esm.sh/@supabase/supabase-js@2'++serve(async (req) => {+ const { user, claims, client_id } = await req.json()++ const supabase = createClient(Deno.env.get('SUPABASE_URL')!, Deno.env.get('SUPABASE_SECRET_KEY')!)++ // Add custom claims based on OAuth client+ let customClaims = {}++ if (client_id === 'mobile-app-client-id') {+ customClaims.aud = 'https://mobile.myapp.com'+ customClaims.app_version = '2.0.0'+ customClaims.platform = 'mobile'+ } else if (client_id === 'analytics-client-id') {+ customClaims.aud = 'https://analytics.myapp.com'+ customClaims.read_only = true+ customClaims.data_retention_days = 90+ } else if (client_id?.startsWith('mcp-')) {+ // MCP AI agents+ const { data: agent } = await supabase+ .from('approved_ai_agents')+ .select('name, max_data_retention_days')+ .eq('client_id', client_id)+ .single()++ customClaims.aud = `https://mcp.myapp.com/${client_id}`+ customClaims.ai_agent = true+ customClaims.agent_name = agent?.name+ customClaims.max_retention = agent?.max_data_retention_days+ }++ return new Response(JSON.stringify({ claims: customClaims }), {+ headers: { 'Content-Type': 'application/json' },+ })+})+```++Use these custom claims in RLS:++```sql+-- Policy based on custom claims+CREATE POLICY "Read-only clients cannot modify"+ON user_data FOR UPDATE+USING (+ auth.uid() = user_id AND+ (auth.jwt() -> 'user_metadata' ->> 'read_only')::boolean IS NOT TRUE+);++-- Policy based on audience claim+CREATE POLICY "Only specific audience can access"+ON api_data FOR SELECT+USING (+ auth.uid() = user_id AND+ (auth.jwt() ->> 'aud') IN (+ 'https://api.myapp.com',+ 'https://mobile.myapp.com'+ )+);+```++## Security best practices++### 1. Principle of least privilege++Grant OAuth clients only the minimum permissions they need:++```sql+-- Bad: Grant all access by default+CREATE POLICY "OAuth clients full access"+ON user_data FOR ALL+USING (auth.uid() = user_id);++-- Good: Grant specific access per client+CREATE POLICY "Specific client specific access"+ON user_data FOR SELECT+USING (+ auth.uid() = user_id AND+ (auth.jwt() ->> 'client_id') = 'trusted-client-id'+);+```++### 2. Separate policies for OAuth clients++Create dedicated policies for OAuth clients rather than mixing them with user policies:++```sql+-- User access+CREATE POLICY "Users access their own data"+ON user_data FOR ALL+USING (+ auth.uid() = user_id AND+ (auth.jwt() ->> 'client_id') IS NULL+);++-- OAuth client access (separate policy)+CREATE POLICY "OAuth clients limited access"+ON user_data FOR SELECT+USING (+ auth.uid() = user_id AND+ (auth.jwt() ->> 'client_id') IN ('client-1', 'client-2')+);+```++### 3. Regularly audit OAuth clients++Track and review which clients have access:++```sql+-- View all active OAuth clients+SELECT+ oc.client_id,+ oc.name,+ oc.created_at,+ COUNT(DISTINCT s.user_id) as active_users+FROM auth.oauth_clients oc+LEFT JOIN auth.sessions s ON s.client_id = oc.client_id+WHERE s.created_at > NOW() - INTERVAL '30 days'+GROUP BY oc.client_id, oc.name, oc.created_at;+```++## Testing your policies++Always test your RLS policies before deploying to production:++```sql+-- Test as a specific OAuth client+SET request.jwt.claims = '{+ "sub": "test-user-uuid",+ "role": "authenticated",+ "client_id": "test-client-id"+}';++-- Test queries+SELECT * FROM user_data WHERE user_id = 'test-user-uuid';++-- Reset+RESET request.jwt.claims;+```++Or use the Supabase Dashboard's [RLS policy tester](/dashboard/project/_/auth/policies).++## Troubleshooting++### Policy not working for OAuth client++**Problem**: OAuth client can't access data despite having a valid token.++**Check**:++1. Verify the policy includes the client's `client_id`+2. Ensure RLS is enabled on the table+3. Check for conflicting restrictive policies+4. Test with service role key to isolate RLS issues++```sql+-- Debug: See what client_id is in the token+SELECT auth.jwt() ->> 'client_id';++-- Debug: Test without RLS+SET LOCAL role = service_role;+SELECT * FROM your_table;+```++### Policy too permissive++**Problem**: OAuth client has access to data it shouldn't.++**Solution**: Use `AS RESTRICTIVE` policies to add additional constraints:++```sql+-- This policy runs in addition to permissive policies+CREATE POLICY "Restrict OAuth clients"+ON sensitive_data+AS RESTRICTIVE+FOR ALL+TO authenticated+USING (+ -- OAuth clients cannot access this table at all+ (auth.jwt() ->> 'client_id') IS NULL+);+```++### Can't differentiate between users and OAuth clients++**Problem**: Need to apply different logic for direct user sessions vs OAuth.++**Solution**: Check if `client_id` is present:++```sql+-- Direct user sessions (no OAuth)+CREATE POLICY "Direct users full access"+ON user_data FOR ALL+USING (+ auth.uid() = user_id AND+ (auth.jwt() ->> 'client_id') IS NULL+);++-- OAuth clients (limited access)+CREATE POLICY "OAuth clients read only"+ON user_data FOR SELECT+USING (+ auth.uid() = user_id AND+ (auth.jwt() ->> 'client_id') IS NOT NULL+);+```++## Next steps++- [Learn about JWTs](/docs/guides/auth/jwts) - Deep dive into Supabase token structure+- [Row Level Security](/docs/guides/auth/row-level-security) - Complete RLS guide+- [Custom Access Token Hooks](/docs/guides/auth/auth-hooks/custom-access-token-hook) - Inject custom claims+- [OAuth flows](/docs/guides/auth/oauth-server/oauth-flows) - Understand token issuancediff --git a/apps/docs/content/guides/auth/redirect-urls.mdx b/apps/docs/content/guides/auth/redirect-urls.mdxindex fb9d07676cb..1175fd86dd6 100644--- a/apps/docs/content/guides/auth/redirect-urls.mdx+++ b/apps/docs/content/guides/auth/redirect-urls.mdx@@ -9,6 +9,14 @@ subtitle: 'Set up redirect urls with Supabase Auth.'Supabase Auth allows you to control how the [user sessions](/docs/guides/auth/sessions) are handled by your application.+<Admonition type="note">++**Looking for OAuth client redirect URIs?**++This guide covers redirect URLs for users signing **into** your application (using social providers like Google, GitHub, etc.). If you're setting up your Supabase project as an **OAuth 2.1 provider** for third-party applications, see the [OAuth Server Redirect URI configuration](/docs/guides/auth/oauth-server/getting-started#redirect-uri-configuration) instead.++</Admonition>+When using [passwordless sign-ins](/docs/reference/javascript/auth-signinwithotp) or [third-party providers](/docs/reference/javascript/auth-signinwithoauth#sign-in-using-a-third-party-provider-with-redirect), the Supabase client library provides a `redirectTo` parameter to specify where to redirect the user after authentication. The URL in `redirectTo` should match the [Redirect URLs](/dashboard/project/_/auth/url-configuration) list configuration.To configure allowed redirect URLs, go to the [URL Configuration](/dashboard/project/_/auth/url-configuration) page. Once you've added necessary URLs, you can use the URL you want the user to be redirected to in the `redirectTo` parameter.diff --git a/supa-mdx-lint/Rule001HeadingCase.toml b/supa-mdx-lint/Rule001HeadingCase.tomlindex 5e559e3a652..e046d71d57f 100644--- a/supa-mdx-lint/Rule001HeadingCase.toml+++ b/supa-mdx-lint/Rule001HeadingCase.toml@@ -135,6 +135,7 @@ may_uppercase = ["Marketplace","Mixpeek","Mixpeek Embed",+ "Model Context Protocol","MySQL","Navigable Small World","Neon",@@ -146,6 +147,7 @@ may_uppercase = ["Okta","Ollama","OpenAI",+ "OpenID Connect","Open ID Connect","OrbStack","OrioleDB",diff --git a/supa-mdx-lint/Rule003Spelling.toml b/supa-mdx-lint/Rule003Spelling.tomlindex bb972d24e21..c8d32266ab1 100644--- a/supa-mdx-lint/Rule003Spelling.toml+++ b/supa-mdx-lint/Rule003Spelling.toml@@ -22,6 +22,7 @@ allow_list = ["[A-Za-z0-9_-]+(\\.[A-Z-a-z0-9_-]+)+(\\/[A-Za-z0-9_-]+)*","[Aa]dd-ons?","[Aa]llowlists?",+ "[Aa]uditability","[Aa]utomations?","[Aa]utovacuum(s|ing|ed)?","[Bb]ackend",@@ -181,6 +182,7 @@ allow_list = ["Erlang","ESZip","Ethereum",+ "FastMCP","Fiberplane","Figma","Firestore",@@ -312,6 +314,7 @@ allow_list = ["Uppy","Upstash","[Uu]pvote(s|d)?",+ "userinfo","VSCode","Vecs","Vercel",@@ -396,6 +399,7 @@ allow_list = ["uBlock Origin","unbilled","untrusted",+ "UserInfo","vCPUs","vecs","vs",