Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

feat: add third-party auth docs (#28423)

Stojan Dimitrovski27beb926c05b
diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts
index 2f88badac98..a8fb38e78bc 100644
--- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts
+++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts
@@ -576,6 +576,15 @@ export const auth = {
},
],
},
+ {
+ name: 'Third-party auth',
+ items: [
+ { name: 'Overview', url: '/guides/auth/third-party/overview' },
+ { name: 'Firebase Auth', url: '/guides/auth/third-party/firebase-auth' },
+ { name: 'Auth0', url: '/guides/auth/third-party/auth0' },
+ { name: 'AWS Cognito (Amplify)', url: '/guides/auth/third-party/aws-cognito' },
+ ],
+ },
{
name: 'Configuration',
items: [
diff --git a/apps/docs/content/guides/auth/third-party/auth0.mdx b/apps/docs/content/guides/auth/third-party/auth0.mdx
new file mode 100644
index 00000000000..d1012d4cfc9
--- /dev/null
+++ b/apps/docs/content/guides/auth/third-party/auth0.mdx
@@ -0,0 +1,121 @@
+---
+id: 'auth-third-party-auth0'
+title: 'Auth0'
+subtitle: 'Use Auth0 with your Supabase project'
+---
+
+Auth0 can be used as a third-party authentication provider alongside Supabase Auth, or standalone, with your Supabase project.
+
+## Getting started
+
+1. First you need to add an integration to connect your Supabase project with your Auth0 tenant. You will need your tenant ID (and in some cases region ID).
+2. Add a new Third-party Auth integration in your project's [Authentication settings](/dashboard/project/_/settings/auth).
+3. Assign the `role: 'authenticated'` custom claim to all JWTs by using an Auth0 Action.
+4. Finally setup the Supabase client in your application.
+
+## Setup the Supabase client library
+
+<Tabs type="underlined" queryGroup="auth0-create-client">
+
+<TabPanel id="ts" label="TypeScript">
+
+```typescript
+import { createClient } from '@supabase/supabase-js'
+
+const supabase = createClient('https://<supabase-project>.supabase.co', 'SUPABASE_ANON_KEY', {
+ accessToken: async () => {
+ const accessToken = await auth0.getTokenSilently()
+
+ // Alternatively you can use (await auth0.getIdTokenClaims()).__raw to
+ // use an ID token instead.
+
+ return accessToken
+ },
+})
+```
+
+</TabPanel>
+
+<TabPanel id="swift" label="Swift (iOS)">
+
+```swift
+import Auth0
+import Supabase
+
+extension CredentialsManager {
+ static let shared = Auth0.CredentialsManager(authentication: Auth0.authentication())
+}
+
+let supabase = SupabaseClient(
+ supabaseURL: URL(string: "https://<supabase-project>.supabase.co")!,
+ supabaseKey: "SUPABASE_ANON_KEY",
+ options: SupabaseClientOptions(
+ auth: SupabaseClientOptions.AuthOptions(
+ accessToken: {
+ try await CredentialsManager.shared.credentials().idToken
+ }
+ )
+ )
+)
+```
+
+</TabPanel>
+
+<TabPanel id="dart" label="Flutter">
+
+```dart
+import 'package:auth0_flutter/auth0_flutter.dart';
+import 'package:flutter/material.dart';
+import 'package:supabase_flutter/supabase_flutter.dart';
+
+Future<void> main() async {
+ final auth0 = Auth0('AUTH0_DOMAIN', 'AUTH0_CLIENT_ID');
+ await Supabase.initialize(
+ url: 'https://<supabase-project>.supabase.co',
+ anonKey: 'SUPABASE_ANON_KEY',
+ accessToken: () async {
+ final credentials = await auth0.credentialsManager.credentials();
+ return credentials.accessToken;
+ },
+ );
+ runApp(const MyApp());
+}
+```
+
+</TabPanel>
+
+</Tabs>
+
+## Add a new Third-Party Auth integration to your project
+
+In the dashboard navigate to your project's [Authentication settings](/dashboard/project/_/settings/auth) and find the Third-Party Auth section to add a new integration.
+
+In the CLI add the following config to your `supabase/config.toml` file:
+
+```toml
+[auth.third_party.auth0]
+enabled = true
+tenant_id = "<id>"
+tenant_region = "<region>" # if your tenant has a region
+```
+
+## Use an Auth0 Action to assign the authenticated role
+
+Your Supabase project inspects the `role` claim present in all JWTs sent to it, to assign the correct Postgres role when using the Data API, Storage or Realtime authorization.
+
+By default, Auth0 JWTs (both access token and ID token) do not contain a `role` claim in them. If you were to send such a JWT to your Supabase project, the `anon` role would be assigned when executing the Postgres query. Most of your app's logic will be accessible by the `authenticated` role.
+
+A recommended approach to do this is to configure the [`onExecutePostLogin` Auth0 Action](https://auth0.com/docs/secure/tokens/json-web-tokens/create-custom-claims#create-custom-claims) which will add the custom claim:
+
+```javascript
+exports.onExecutePostLogin = async (event, api) => {
+ api.accessToken.setCustomClaim('role', 'authenticated')
+}
+```
+
+## Limitations
+
+At this time, Auth0 tenants with the following [signing algorithms](https://auth0.com/docs/get-started/applications/signing-algorithms) are not supported:
+
+- HS256 (HMAC with SHA-256) -- also known as symmetric JWTs
+- PS256 (RSA-PSS with SHA-256)
diff --git a/apps/docs/content/guides/auth/third-party/aws-cognito.mdx b/apps/docs/content/guides/auth/third-party/aws-cognito.mdx
new file mode 100644
index 00000000000..afb06285d7a
--- /dev/null
+++ b/apps/docs/content/guides/auth/third-party/aws-cognito.mdx
@@ -0,0 +1,139 @@
+---
+id: 'auth-third-party-aws-cognito'
+title: 'AWS Cognito (Amplify)'
+subtitle: 'Use AWS Cognito via Amplify or standalone with your Supabase project'
+---
+
+AWS Cognito User Pools (via AWS Amplify or on its own) can be used as a third-party authentication provider alongside Supabase Auth, or standalone, with your Supabase project.
+
+## Getting started
+
+1. First you need to add an integration to connect your Supabase project with your AWS Cognito User Pool. You will need the pool's ID and region.
+2. Add a new Third-party Auth integration in your project's [Authentication settings](/dashboard/project/_/settings/auth) or configure it in the CLI.
+3. Assign the `role: 'authenticated'` custom claim to all JWTs by using a Pre-Token Generation Trigger.
+4. Finally setup the Supabase client in your application.
+
+## Setup the Supabase client library
+
+<Tabs type="underlined" queryGroup="cognito-create-client">
+
+<TabPanel id="ts" label="TypeScript (Amplify)">
+
+```typescript
+import { fetchAuthSession, Hub } from 'aws-amplify/auth'
+
+const supabase = createClient('https://<supabase-project>.supabase.co', 'SUPABASE_ANON_KEY', {
+ accessToken: async () => {
+ const tokens = await fetchAuthSession()
+
+ // Alternatively you can use tokens?.idToken instead.
+ return tokens?.accessToken
+ },
+})
+
+// if you're using Realtime you also need to set up a listener for Cognito auth changes
+Hub.listen('auth', () => {
+ fetchAuthSession().then((tokens) => supabase.realtime.setAuth(tokens?.accessToken))
+})
+```
+
+</TabPanel>
+
+<TabPanel id="swift" label="Swift (iOS)">
+
+```swift
+import Supabase
+import AWSPluginsCore
+
+struct UnexpectedAuthSessionError: Error {}
+
+let supabase = SupabaseClient(
+ supabaseURL: URL(string: "https://<supabase-project>.supabase.co")!,
+ supabaseKey: "SUPABASE_ANON_KEY",
+ options: SupabaseClientOptions(
+ auth: SupabaseClientOptions.AuthOptions(
+ accessToken: {
+ let session = try await Amplify.Auth.fetchAuthSession()
+
+ guard let cognitoTokenProvider = session as? AuthCognitoTokensProvider else {
+ throw UnexpectedAuthSessionError()
+ }
+
+ let tokens = try cognitoTokenProvider.getCognitoTokens().get()
+ return tokens.idToken
+ }
+ )
+ )
+)
+```
+
+</TabPanel>
+
+<TabPanel id="dart" label="Flutter">
+
+```dart
+import 'package:amplify_auth_cognito/amplify_auth_cognito.dart';
+import 'package:amplify_flutter/amplify_flutter.dart';
+import 'package:flutter/material.dart';
+import 'package:supabase_flutter/supabase_flutter.dart';
+
+Future<void> main() async {
+ await Supabase.initialize(
+ url: 'https://<supabase-project>.supabase.co',
+ anonKey: 'SUPABASE_ANON_KEY',
+ accessToken: () async {
+ final session = await Amplify.Auth.fetchAuthSession();
+ final cognitoSession = session as CognitoAuthSession;
+ return cognitoSession.userPoolTokensResult.value.accessToken.raw;
+ },
+ );
+ runApp(const MyApp());
+}
+```
+
+</TabPanel>
+
+</Tabs>
+
+## Add a new Third-Party Auth integration to your project
+
+In the dashboard navigate to your project's [Authentication settings](/dashboard/project/_/settings/auth) and find the Third-Party Auth section to add a new integration.
+
+In the CLI add the following config to your `supabase/config.toml` file:
+
+```toml
+[auth.third_party.aws_cognito]
+enabled = true
+user_pool_id = "<id>"
+user_pool_region = "<region>"
+```
+
+## Use a Pre-Token Generation Trigger to assign the authenticated role
+
+Your Supabase project inspects the `role` claim present in all JWTs sent to it, to assign the correct Postgres role when using the Data API, Storage or Realtime authorization.
+
+By default, AWS Cognito JWTs (both ID token and access tokens) do not contain a `role` claim in them. If you were to send such a JWT to your Supabase project, the `anon` role would be assigned when executing the Postgres query. Most of your app's logic will be accessible by the `authenticated` role.
+
+A recommended approach to do this is to configure a [Pre-Token Generation Trigger](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-token-generation.html) either `V1_0` (ID token only) or `V2_0` (both access and ID token). To do this you will need to create a new Lambda function (in any language and runtime) and assign it to the [AWS Cognito User Pool's Lambda Triggers configuration](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html). For example, the Lambda function should look similar to this:
+
+<Tabs type="underlined" queryGroup="cognito-lambda">
+
+<TabPanel id="blocking-nodejs" label="Node.js">
+
+```javascript
+export const handler = async (event) => {
+ event.response = {
+ claimsOverrideDetails: {
+ claimsToAddOrOverride: {
+ role: 'authenticated',
+ },
+ },
+ }
+
+ return event
+}
+```
+
+</TabPanel>
+
+</Tabs>
diff --git a/apps/docs/content/guides/auth/third-party/firebase-auth.mdx b/apps/docs/content/guides/auth/third-party/firebase-auth.mdx
new file mode 100644
index 00000000000..f82721e5558
--- /dev/null
+++ b/apps/docs/content/guides/auth/third-party/firebase-auth.mdx
@@ -0,0 +1,292 @@
+---
+id: 'auth-third-party-firebase-auth'
+title: 'Firebase Auth'
+subtitle: 'Use Firebase Auth with your Supabase project'
+---
+
+<Admonition type="note">
+
+Creating a Firebase Auth third-party integration with your Supabase project is currently limited to a private alpha release. We are still trying to improve the developer experience around securing your project. [Register your interest in Third-Party Auth with Firebase](https://forms.supabase.com/third-party-auth-with-firebase) and the team will reach out to you.
+
+</Admonition>
+
+Firebase Auth can be used as a third-party authentication provider alongside Supabase Auth, or standalone, with your Supabase project.
+
+## Getting started
+
+1. First you need to add an integration to connect your Supabase project with your Firebase project. You will need to get the Project ID in the [Firebase Console](https://console.firebase.google.com/u/0/project/_/settings/general).
+2. Add a new Third-party Auth integration in your project's [Authentication settings](/dashboard/project/_/settings/auth).
+3. If you are using Third Party Auth in local development, create and attach restrictive RLS policies to all tables in your public schema, Storage and Realtime to prevent unauthorized access from unrelated Firebase projects.
+4. Assign the `role: 'authenticated'` [custom user claim](https://firebase.google.com/docs/auth/admin/custom-claims) to all your users.
+5. Finally set up the Supabase client in your application.
+
+## Setup the Supabase client library
+
+<Tabs type="underlined" queryGroup="firebase-create-client">
+
+<TabPanel id="ts" label="TypeScript">
+
+Creating a client for the Web is as easy as passing the `accessToken` async function. This function should [return the Firebase Auth JWT of the current user](https://firebase.google.com/docs/auth/admin/verify-id-tokens#web) (or null if no such user) is found.
+
+```typescript
+import { createClient } from '@supabase/supabase-js'
+
+const supabase = createClient('https://<supabase-project>.supabase.co', 'SUPABASE_ANON_KEY', {
+ accessToken: async () => {
+ ;(await firebase.auth().currentUser?.getIdToken(/* forceRefresh */ false)) ?? null
+ },
+})
+```
+
+Make sure the all users in your application have the `role: 'authenticated'` [custom claim](https://firebase.google.com/docs/auth/admin/custom-claims) set. If you're using the `onCreate` Cloud Function to add this custom claim to newly signed up users, you will need to call `getIdToken(/* forceRefresh */ true)` immediately after sign up as the `onCreate` function does not run synchronously.
+
+</TabPanel>
+
+<TabPanel id="swift" label="Swift (iOS)">
+
+```swift
+import Supabase
+import FirebaseAuth
+
+struct MissingFirebaseTokenError: Error {}
+
+let supabase = SupabaseClient(
+ supabaseURL: URL(string: "https://<supabase-project>.supabase.co")!,
+ supabaseKey: "SUPABASE_ANON_KEY",
+ options: SupabaseClientOptions(
+ auth: SupabaseClientOptions.AuthOptions(
+ accessToken: {
+ guard let token = await Auth.auth().currentUser?.getIDToken() else {
+ throw MissingFirebaseTokenError()
+ }
+
+ return token
+ }
+ )
+ )
+)
+```
+
+</TabPanel>
+
+</Tabs>
+
+## Add a new Third-Party Auth integration to your project
+
+In the dashboard navigate to your project's [Authentication settings](/dashboard/project/_/settings/auth) and find the Third-Party Auth section to add a new integration.
+
+In the CLI add the following config to your `supabase/config.toml` file:
+
+```toml
+[auth.third_party.firebase]
+enabled = true
+project_id = "<id>"
+```
+
+## Adding an extra layer of security to your project's RLS policies
+
+<Admonition type="note">
+
+While Third-Party Auth with Firebase is in a private alpha, it is strongly recommended to follow this guide closely. Once it becomes generally available this method would not be necessary to secure your project against unauthorized access from other Firebase projects.
+
+You should also follow this best practice if self-hosting.
+
+</Admonition>
+
+Firebase Auth uses a single set of JWT signing keys for all projects. This means that JWTs issued from an unrelated Firebase project to yours could access data in your Supabase project. To guard against this, creating and maintaining the following RLS policies for **all of your tables in the `public` schema** is very important. You should also attach this policy to [Storage](/docs/guides/storage/security/access-control) buckets or [Realtime](/docs/guides/realtime/authorization) channels.
+
+To achieve this we recommend using a [restrictive Postgres Row-Level Security policy](https://www.postgresql.org/docs/current/sql-createpolicy.html).
+
+Restrictive RLS policies differ from regular (or permissive) policies in that they use the `as restrictive` clause when being defined. They do not grant permissions, but rather restrict any existing or future permissions. They're great for cases like this where the technical limitations of Firebase Auth remain separate from your app's logic.
+
+<Admonition type="danger">
+
+Postgres has two types of policies: permissive and restrictive. This example uses restrictive policies so make sure you don't omit the `as restrictive` clause.
+
+</Admonition>
+
+This is an example of such an RLS policy that will restrict access to only your project's (denoted with `<firebase-project-id>`) users, and not any other Firebase project.
+
+```sql
+create policy "Restrict access to Supabase Auth and Firebase Auth for project ID <firebase-project-id>"
+ on table_name
+ as restrictive
+ to authenticated
+ using (
+ (auth.jwt()->>'iss' = 'https://<project-ref>.supabase.co/auth/v1')
+ or
+ (
+ auth.jwt()->>'iss' = 'https://securetoken.google.com/<firebase-project-id>'
+ and
+ auth.jwt()->>'aud' = '<firebase-project-id>'
+ )
+ );
+```
+
+If you have a lot of tables in your app, or need to manage complex RLS policies for [Storage](/docs/guides/storage) or [Realtime](/docs/guides/realtime) it can be useful to define a [stable Postgres function](https://www.postgresql.org/docs/current/xfunc-volatility.html) that performs the check to cut down on duplicate code. For example:
+
+```sql
+create function public.is_supabase_or_firebase_project_jwt()
+ returns bool
+ language sql
+ stable
+ returns null on null input
+ return (
+ (auth.jwt()->>'iss' = 'https://<project-ref>.supabase.co/auth/v1')
+ or
+ (
+ auth.jwt()->>'iss' = concat('https://securetoken.google.com/<firebase-project-id>')
+ and
+ auth.jwt()->>'aud' = '<firebase-project-id>'
+ )
+ );
+```
+
+Make sure you substitute `<project-ref>` with your Supabase project's ID and the `<firebase-project-id>` to your Firebase Project ID. Then the restrictive policies on all your tables, buckets and channels can be simplified to be:
+
+```sql
+create policy "Restrict access to correct Supabase and Firebase projects"
+ on table_name
+ as restrictive
+ to authenticated
+ using ((select public.is_supabase_or_firebase_project_jwt()) is true);
+```
+
+## Assign the "role" custom claim
+
+Your Supabase project inspects the `role` claim present in all JWTs sent to it, to assign the correct Postgres role when using the Data API, Storage or Realtime authorization.
+
+By default, Firebase JWTs do not contain a `role` claim in them. If you were to send such a JWT to your Supabase project, the `anon` role would be assigned when executing the Postgres query. Most of your app's logic will be accessible by the `authenticated` role.
+
+### Use Firebase Authentication functions to assign the authenticated role
+
+You have two choices to set up a Firebase Authentication function depending on your Firebase project's configuration:
+
+1. Easiest: Use a [blocking Firebase Authentication function](https://firebase.google.com/docs/auth/extend-with-blocking-functions) but this is only available if your project uses [Firebase Authentication with Identity Platform](https://cloud.google.com/security/products/identity-platform).
+2. Manually assign the custom claims to all users with the [admin SDK](https://firebase.google.com/docs/auth/admin/custom-claims#set_and_validate_custom_user_claims_via_the_admin_sdk) and define an [`onCreate` Firebase Authentication Cloud Function](https://firebase.google.com/docs/auth/extend-with-functions) to persist the role to all newly created users.
+
+<Tabs type="underlined" queryGroup="firebase-functions">
+
+<TabPanel id="blocking-nodejs" label="Node.js (Blocking Functions Gen 2)">
+
+```typescript
+import { beforeUserCreated, beforeUserSignedIn } from 'firebase-functions/v2/identity'
+
+export const beforecreated = beforeUserCreated((event) => {
+ return {
+ customClaims: {
+ // The Supabase project will use this role to assign the `authenticated`
+ // Postgres role.
+ role: 'authenticated',
+ },
+ }
+})
+
+export const beforesignedin = beforeUserSignedIn((event) => {
+ return {
+ customClaims: {
+ // The Supabase project will use this role to assign the `authenticated`
+ // Postgres role.
+ role: 'authenticated',
+ },
+ }
+})
+```
+
+Note that instead of using `customClaims` you can instead use `sessionClaims`. The difference is that `session_claims` are not saved in the Firebase user profile, but remain valid for as long as the user is signed in.
+
+</TabPanel>
+
+<TabPanel id="blocking-python" label="Python (Blocking Functions Gen 2)">
+
+```python
+@identity_fn.before_user_created()
+def set_supabase_role_sign_up(event: identity_fn.AuthBlockingEvent) -> identity_fn.BeforeCreateResponse | None:
+ return identity_fn.BeforeCreateResponse(
+ # The Supabase project will use this role to assign the `authenticated`
+ # Postgres role.
+ custom_claims={'role': 'authenticated'})
+
+@identity_fn.before_user_signed_in()
+def set_supabase_role_sign_in(event: identity_fn.AuthBlockingEvent) -> identity_fn.BeforeSignInResponse | None:
+ return identity_fn.BeforeSignInResponse(
+ # The Supabase project will use this role to assign the `authenticated`
+ # Postgres role.
+ custom_claims={'role': 'authenticated'})
+```
+
+Note that instead of using `custom_claims` you can instead use `session_claims`. The difference is that `session_claims` are not saved in the Firebase user profile, but remain valid for as long as the user is signed in.
+
+</TabPanel>
+
+<TabPanel id="oncreate-nodejs" label="onCreate Cloud Function in Node.js">
+
+```javascript
+const functions = require('firebase-functions')
+const { initializeApp } = require('firebase-admin/app')
+const { getAuth } = require('firebase-admin/auth')
+const { getDatabase } = require('firebase-admin/database')
+
+initializeApp()
+
+// On sign up.
+exports.processSignUp = functions.auth.user().onCreate(async (user) => {
+ try {
+ // Set custom user claims on this newly created user.
+ await getAuth().setCustomUserClaims(user.uid, {
+ role: 'authenticated',
+ })
+ } catch (error) {
+ console.log(error)
+ }
+})
+```
+
+Note that the `onCreate` Firebase Cloud Function is not _synchronous_ (unlike the Blocking Functions), so the very first ID token received by the Firebase client library in your app _will not contain_ the `role: 'authenticated'` claim. Force-refresh the ID token immediately after sign-up to fetch an ID token with the applied role.
+
+</TabPanel>
+
+</Tabs>
+
+Finally deploy your functions for the changes to take effect:
+
+```
+firebase deploy --only functions
+```
+
+Note that these functions are only called on new sign-ups and sign-ins. Existing users will not have these claims in their ID tokens. You will need to use the admin SDK to assign the role custom claim to all users. Make sure you do this after the blocking Firebase Authentication functions as described above are deployed.
+
+### Use the admin SDK to assign the role custom claim to all users
+
+You need to run a script that will assign the `role: 'authenticated'` custom claim to all of your existing Firebase Authentication users. You can do this by combining the [list users](https://firebase.google.com/docs/auth/admin/manage-users#list_all_users) and [set custom user claims](https://firebase.google.com/docs/auth/admin/create-custom-tokens) admin APIs. An example script is provided below:
+
+```javascript
+'use strict';
+const { initializeApp } = require('firebase-admin/app');
+const { getAuth } = require('firebase-admin/auth');
+initializeApp();
+
+async function setRoleCustomClaim() => {
+ let nextPageToken = undefined
+
+ do {
+ const listUsersResult = await getAuth().listUsers(1000, nextPageToken)
+
+ nextPageToken = listUsersResult.pageToken
+
+ await Promise.all(listUsersResult.users.map(async (userRecord) => {
+ try {
+ await getAuth().setCustomUserClaims(userRecord.id, {
+ role: 'authenticated'
+ })
+ } catch (error) {
+ console.error('Failed to set custom role for user', userRecord.id)
+ }
+ })
+ } while (nextPageToken);
+};
+
+setRoleCustomClaim().then(() => process.exit(0))
+```
+
+After all users have received the `role: 'authenticated'` claim, it will appear in all newly issued ID tokens for the user.
diff --git a/apps/docs/content/guides/auth/third-party/overview.mdx b/apps/docs/content/guides/auth/third-party/overview.mdx
new file mode 100644
index 00000000000..041be2090b4
--- /dev/null
+++ b/apps/docs/content/guides/auth/third-party/overview.mdx
@@ -0,0 +1,29 @@
+---
+id: 'auth-third-party-overview'
+title: 'Third-party auth'
+subtitle: 'First-class support for authentication providers'
+---
+
+Supabase has first-class support for these third-party authentication providers:
+
+- [Firebase Auth](/docs/guides/auth/third-party/firebase-auth)
+- [Auth0](/docs/guides/auth/third-party/auth0)
+- [AWS Cognito (with or without AWS Amplify)](/docs/guides/auth/third-party/aws-cognito)
+
+You can use these providers alongside Supabase Auth, or on their own, to access the [Data API (REST and GraphQL)](/docs/guides/database), [Storage](/docs/guides/storage), [Realtime](/docs/guides/storage) and [Functions](/docs/guides/functions) from your existing apps.
+
+If you already have production apps using one of these authentication providers, and would like to use a Supabase feature, you no longer need to migrate your users to Supabase Auth or use work-arounds like translating JWTs into the Supabase Auth format and using your project's signing secret.
+
+## How does it work?
+
+To use Supabase products like Data APIs for your Postgres database, Storage or Realtime, you often need to send access tokens or JWTs via the Supabase client libraries or via the REST API. Third-party auth support means that when you add a new integration with one of these providers, the API will trust JWTs issued by the provider similar to how it trusts JWTs issued by Supabase Auth.
+
+This is made possible if the providers are using JWTs signed with asymmetric keys, which means that the Supabase APIs will be able to only verify but not create JWTs.
+
+## Limitations
+
+There are some limitations you should be aware of when using third-party authentication providers with Supabase.
+
+1. The third-party provider must use asymmetrically signed JWTs (exposed as an OIDC Issuer Discovery URL by the third-party authentication provider). Using symmetrically signed JWTs is not possible at this time.
+2. The JWT signing keys from the third-party provider are stored in the configuration of your project, and are checked for changes periodically. If you are rotating your keys (when supported) allow up to 30 minutes for the change to be picked up.
+3. It is not possible to disable Supabase Auth at this time.