Saltar al contenido

Supabase Apple Login - General Configuración

Esta guía Va a help you integrate Apple Sign-In with Supabase Authentication. Apple Sign-In provides a secure, privacy-focused authentication Método that works across iOS, Android, and Web platforms.

Before starting, ensure you have:

  1. Created a Supabase project

  2. Read El Apple Login General Setup Guía A Configuración Apple OAuth Credenciales

  3. Followed El respective platform-specific guides A Configuración Apple OAuth Credenciales for your target platform:

    Before starting El Supabase Tutorial, Necesita A generate El client IDs for El platforms you plan Para usar.

    For iOS, El client ID is El same as your Aplicación ID. For Android and Web, El client ID is El same as your service ID. Usted Usar them in Paso 7 of Esta guía.

  1. Go A your Supabase Dashboard

  2. Haga clic on your project

    Supabase Project Selector
  3. Do go A El Authentication menu

    Supabase Authentication Menu
  4. Haga clic on El Providers tab

    Supabase Providers Tab
  5. Encontrar El Apple provider

    Supabase Apple Provider
  6. Habilitar El Apple provider

    Supabase Apple Provider Habilitar
  7. Fill in El client ID Configuración:

    Si are using Apple login for iOS, El client ID is El same as your Aplicación ID. Si are using Apple login for Android or Web, El client ID is El same as your service ID. Si are using both, Necesita A provide both El Aplicación ID and El service ID.

    Supabase Apple Provider Client ID
  8. Haga clic on El Save button

    Supabase Apple Provider Guardar

    You DO NOT HAVE A Configuración Secret key (for OAuth). We Va a do a custom backend implementation A handle El Apple login.

Voilà, you have now Habilitado Apple Sign-In with Supabase Authentication 🎉

El Completo implementation includes a helper Función authenticateWithAppleSupabase() that handles El entire Apple Sign-In flow with Supabase. This Función:

  • Initializes Apple Sign-In with platform-specific Configuración
  • Handles El authentication flow (native on iOS, OAuth redirect on Android/Web)
  • Extracts El identity token De Apple
  • Signs in A Supabase with El identity token

Completo Implementation

El Completo implementation is available in El example app’s supabaseAuthUtils.ts file.

import { authenticateWithAppleSupabase } from './supabaseAuthUtils';
const result = await authenticateWithAppleSupabase();
if (result.success) {
console.log('Signed in:', result.user);
// Navigate to your authenticated area
} else {
console.error('Error:', result.error);
}

El helper Función automatically handles platform-specific differences:

  • iOS: Uses native Apple Sign-In (no redirect URL needed, uses Paquete ID automatically)
  • Android: Uses OAuth redirect flow with backend edge Función (requires Service ID)
  • Web: Uses OAuth popup flow (requires Service ID and current page URL as redirect)

El Función returns an identity token De Apple, which is then used A authenticate with Supabase using supabase.auth.signInWithIdToken().