Set up third-party login with Supabase

更新时间:
复制 MD 格式

AnalyticDB for PostgreSQL provides deep integration with the open-source Supabase authentication system. This integration is enhanced to support multiple third-party identity providers, such as Alipay, WeChat, and Google. Use the Supabase Auth service hosted by AnalyticDB for PostgreSQL to quickly enable secure and scalable third-party login for your application, providing one-click sign-in. This topic uses Alipay as an example to show how to configure third-party login for your application.

Prerequisites

  • You have created a Supabase project. Your AnalyticDB for PostgreSQL project must have been created after the following dates:

    • China region: September 4, 2025.

    • Asia Pacific SE 1 (Singapore): August 29, 2025.

    Note

    The supported regions are listed in the console. To confirm support for your project's region, log in to the Supabase Dashboard. If the Authentication > Sign In/Providers menu is visible in the sidebar, your region is supported.

  • You have enabled public access for your AnalyticDB for PostgreSQL project.

Procedure

Step 1: Get Alipay login configuration

  1. Log on to the Alipay Open Platform and register your web or mobile application.

  2. Log on to the Open Platform console, click the Web/Mobile Application tab, and get the ID of your application.

  3. Configure the key signing method and save the application private key. For more information, see the Alipay documentation.

Step 2: Configure the Supabase project

  1. Log on to the Supabase Dashboard.

  2. In the left-side navigation pane, click Authentication > Sign In/Providers.

    image

  3. Configure the Alipay login information.

    Enable Alipay, set the parameters using the information from Step 1, copy the callback URL, and then click save.

    image

Step 3: Configure the Alipay redirect URI

  1. On the Alipay Open Platform, go to the application details page and click Development Settings.

  2. Set the redirect URI to the callback URL that you copied in Step 2.

    The callback URL for Supabase third-party login has the following format: http://<SUPABASE_PUBLIC_URL>/auth/v1/callback.

Step 4: Set the application homepage URL

  1. In the left-side navigation pane of the Supabase Dashboard, click Authentication > URL Configuration.

  2. Change the Site URL to your application homepage, which is the URL where users are redirected after a third-party login.

    image

Sign-in methods

Once configured, your application can use Supabase for third-party login with Alipay.

  • Call the API using a URL.

    In the upper-left corner of the Supabase Dashboard, click Connect. In the dialog box that appears, click App Frameworks to obtain the SUPABASE_PUBLIC_URL.

    http://<SUPABASE_PUBLIC_URL>/auth/v1/authorize?provider=alipay
  • Call the API using supabase-js.

    For installation and usage instructions, see supabase-js.

    const { data, error } = await supabase.auth.signInWithOAuth({
      provider: 'alipay'
    })

Related documentation

To set up login with other third-party identity providers, see the Supabase official documentation.