Skip to content
Auth

第三方认证

First-class support for authentication providers

Supabase 对这些第三方认证提供商有一流的支持:

🌐 Supabase has first-class support for these third-party authentication providers:

你可以将这些提供商与 Supabase Auth 一起使用,或者单独使用它们,从你现有的应用中访问 数据 API(REST 和 GraphQL)存储实时函数

🌐 You can use these providers alongside Supabase Auth, or on their own, to access the Data API (REST and GraphQL), Storage, Realtime and Functions from your existing apps.

如果你已经有使用这些身份验证提供商的生产应用,并且想使用 Supabase 的某个功能,你不再需要将用户迁移到 Supabase Auth,也不需要像将 JWT 转换成 Supabase Auth 格式并使用项目签名密钥这样的变通办法。

🌐 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 workarounds like translating JWTs into the Supabase Auth format and using your project's signing secret.

它是怎么运作的? #

🌐 How does it work?

要使用 Supabase 的产品,比如用于你的 Postgres 数据库的 Data API、Storage 或 Realtime,你通常需要通过 Supabase 客户端库或 REST API 发送访问令牌或 JWT。第三方认证支持意味着,当你添加与这些提供商中的一个的新集成时,API 会像信任 Supabase Auth 发出的 JWT 一样,信任该提供商发出的 JWT。

🌐 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.

如果提供者使用用非对称密钥签名的 JWT,这就有可能实现,这意味着 Supabase API 只能验证 JWT,而不能创建 JWT。

🌐 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

在使用 Supabase 的第三方认证提供商时,你需要注意一些限制。

🌐 There are some limitations you should be aware of when using third-party authentication providers with Supabase.

  1. 第三方提供商必须使用非对称签名的 JWT(由第三方身份验证提供商作为 OIDC 发行者发现 URL 公布)。签名的 JWT 必须有一个 kid 头参数来标识必须使用哪个密钥。目前无法使用对称签名的 JWT。
  2. 第三方提供商的 JWT 签名密钥存储在你项目的配置中,并会定期检查是否有变更。如果你正在轮换密钥(在支持的情况下),请允许最多 30 分钟的时间让更改生效。
  3. 目前无法禁用 Supabase Auth。

价格 #

🌐 Pricing

$0.00325 每个第三方月活跃用户。你只需为超出订阅计划配额的使用量付费。

有关费用如何计算的详细说明,请参阅 管理每月活跃第三方用户使用情况

🌐 For a detailed breakdown of how charges are calculated, refer to Manage Monthly Active Third-Party Users usage.