該如何開始使用 Firebase 驗證?
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
我已經有驗證系統
如果您的應用程式已有登入實作,而您想使用該功能
向 Firebase 後端服務進行驗證,請使用自訂驗證。這個
包含使用下列任一項目的應用程式:
- 自訂解決方案,例如自訂密碼系統。
- 第三方身分管理服務,例如 Auth0 或 Okta。
- 目前已與聯合識別資訊提供者整合,例如 Google
Facebook 或 Apple。(如果尚未支援聯合身分,但
請參閱下一節)。
透過自訂驗證功能,使用者可以透過您選擇的系統
在後端為使用者建立 Firebase 權杖,然後使用權杖
並透過 Firebase 進行驗證
請參閱
iOS+、
Android、
網頁、
Flutter
Unity 或
C++。
我想使用 Firebase 建構驗證系統
如果你正在建立新的應用程式或將登入機制新增至現有應用程式,Firebase 會提供以下功能:
可協助您在沒有服務的情況下導入安全驗證機制的程式庫和服務
而無須自行建立驗證後端Firebase Authentication是
完整的後端解決方案,適用於使用密碼登入的聯合身分
供應商、電子郵件連結和簡訊。
我需要一個易於使用的置入式解決方案
如要為應用程式新增驗證,最便捷的方式是使用
FirebaseUI 驗證,這是內建的 UI 程式庫。FirebaseUI 可導入完整的使用者
Firebase Authentication 所有支援登入方法的流程。
FirebaseUI 驗證是置入式解決方案,因此具有特定使用者體驗
不符合您的需求如要變更使用者體驗,可以建立程式庫分支
是開放原始碼的,使用您自己的版本但基本上
建議您透過
我們將在下一節介紹 Firebase SDK。
請參閱 的 FirebaseUI 驗證文件:
iOS、
Android,或
網頁。
我想完全掌控登入體驗
如要進一步控管應用程式的登入體驗,
驗證流程,並透過 Firebase SDK 與 Firebase 的
驗證服務例如,建立自己的電子郵件地址和密碼。
流程或 Google 登入流程,然後將使用者的電子郵件地址和密碼
匯出至 Firebase 以驗證使用者。
請參閱 Firebase Authentication SDK 文件:
我想打造豐富的預先登入體驗
您可以讓使用者提前使用應用程式的登入功能
實際上是使用匿名驗證登入。有了匿名的「登入」功能
暫時的單一工作階段帳戶 (運作方式類似實際帳戶)。接著:
在使用者登入或註冊後,將臨時帳戶連結至
,讓他們從上次中斷的地方繼續
匿名驗證可與自訂驗證或任何 Firebase 的
驗證服務
請參閱
iOS+、
Android、
網頁、
Flutter
Unity 或
C++。
我想從後端存取 Firebase 服務
如要從伺服器存取 Firebase 服務,不需要使用
Firebase Authentication。請改用 Admin SDK。當您
初始化 Admin SDK、使用服務帳戶憑證進行驗證,
用來代表 Firebase 專案,而非特定使用者
授予專案資源的完整存取權。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[],[],null,["# Where do I start with Firebase Authentication?\n\nI already have an authentication system\n---------------------------------------\n\nIf your app already has a sign-in implementation and you want to use it to\nauthenticate with Firebase backend services, use **Custom Authentication**. This\nincludes apps that use any of the following:\n\n- Custom-built solutions, such as custom password-based systems.\n- Third-party identity management services, such as Auth0 or Okta.\n- Existing integrations with federated identity providers, such as Google, Facebook, or Apple. (And if you don't yet support federated identity, but you want to, see the next section.)\n\nWith custom authentication, you sign users in with the system of your choice,\ncreate a Firebase token for the user on your backend, and then use the token\nfrom the client to authenticate with Firebase.\n\nSee the docs for\n[iOS+](/docs/auth/ios/custom-auth),\n[Android](/docs/auth/android/custom-auth),\n[Web](/docs/auth/web/custom-auth),\n[Flutter](/docs/auth/flutter/custom-auth),\n[Unity](/docs/auth/unity/custom-auth), or\n[C++](/docs/auth/cpp/custom-auth).\n\nI want to build my authentication system with Firebase\n------------------------------------------------------\n\nIf you're building a new app or adding sign-in to an existing app, Firebase has\nlibraries and services that can help you implement secure authentication without\nhaving to build the authentication backend yourself. Firebase Authentication is a\ncomplete backend solution for signing in with passwords, federated identity\nproviders, email links, and text messages.\n\n#### I want a drop-in solution that's easy to use\n\nThe fastest and easiest way to add authentication to an app is to use\n**FirebaseUI Auth** , a drop-in UI library. FirebaseUI implements complete user\nflows for all of Firebase Authentication's supported sign-in methods.\n\nBecause FirebaseUI Auth is a drop-in solution, it has a specific UX that might\nnot meet your needs. If you want to change the UX, you can fork the library,\nwhich is open source, and use your own version. However, for substantially\ndifferent sign-in flows, you might prefer to implement your own flows with the\nFirebase SDK as discussed in the next section.\n\nSee the FirebaseUI Auth docs for\n[iOS](/docs/auth/ios/firebaseui),\n[Android](/docs/auth/android/firebaseui), or\n[Web](/docs/auth/web/firebaseui).\n\n#### I want full control over the sign-in experience\n\nFor more control over your app's sign-in experience, you can implement your own\nauthentication flows and use the Firebase SDK to work with Firebase's\nauthentication services. For example, build your own email address and password\nflow or Google Sign-in flow, and pass the user's email address and password or\nGoogle ID token to Firebase to authenticate the user.\n\nSee the Firebase Authentication SDK docs:\n\n| Firebase services ||\n|----------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **Email address and password sign-in** | [iOS+](/docs/auth/ios/password-auth) \\| [Android](/docs/auth/android/password-auth) \\| [Web](/docs/auth/web/password-auth) \\| [Flutter](/docs/auth/flutter/password-auth) \\| [Unity](/docs/auth/unity/password-auth) \\| [C++](/docs/auth/cpp/password-auth) |\n| **Phone number sign-in** | [iOS+](/docs/auth/ios/phone-auth) \\| [Android](/docs/auth/android/phone-auth) \\| [Web](/docs/auth/web/phone-auth) \\| [Flutter](/docs/auth/flutter/phone-auth) \\| [Unity](/docs/auth/unity/phone-auth) \\| [C++](/docs/auth/cpp/phone-auth) |\n| **Email link sign-in** | [iOS+](/docs/auth/ios/email-link-auth) \\| [Android](/docs/auth/android/email-link-auth) \\| [Web](/docs/auth/web/email-link-auth) \\| [Flutter](/docs/auth/flutter/email-link-auth) \\| [Unity](/docs/auth/unity/email-link-auth) \\| [C++](/docs/auth/cpp/email-link-auth) |\n| **Google** | [iOS+](/docs/auth/ios/google-signin) \\| [Android](/docs/auth/android/google-signin) \\| [Web](/docs/auth/web/google-signin) \\| [Flutter](/docs/auth/flutter/federated-auth#google) \\| [Unity](/docs/auth/unity/google-signin) \\| [C++](/docs/auth/cpp/google-signin) |\n| **Facebook** | [iOS+](/docs/auth/ios/facebook-login) \\| [Android](/docs/auth/android/facebook-login) \\| [Web](/docs/auth/web/facebook-login) \\| [Flutter](/docs/auth/flutter/federated-auth#facebook) \\| [Unity](/docs/auth/unity/facebook-login) \\| [C++](/docs/auth/cpp/facebook-login) |\n| **Apple** | [iOS+](/docs/auth/ios/apple) \\| [Android](/docs/auth/android/apple) \\| [Web](/docs/auth/web/apple) \\| [Flutter](/docs/auth/flutter/federated-auth#apple) \\| [Unity](/docs/auth/unity/apple) \\| [C++](/docs/auth/cpp/apple) |\n| **Play Games** | [Android](/docs/auth/android/play-games) \\| [Unity](/docs/auth/unity/play-games) \\| [C++](/docs/auth/cpp/play-games) |\n| **Game Center** | [iOS+](/docs/auth/ios/game-center) |\n| **GitHub** | [iOS+](/docs/auth/ios/github-auth) \\| [Android](/docs/auth/android/github-auth) \\| [Web](/docs/auth/web/github-auth) \\| [Flutter](/docs/auth/flutter/federated-auth#github) \\| [Unity](/docs/auth/unity/github-auth) \\| [C++](/docs/auth/cpp/github-auth) |\n| **Microsoft** | [iOS+](/docs/auth/ios/microsoft-oauth) \\| [Android](/docs/auth/android/microsoft-oauth) \\| [Web](/docs/auth/web/microsoft-oauth) \\| [Unity](/docs/auth/unity/microsoft-oauth) \\| [C++](/docs/auth/cpp/microsoft-oauth) |\n| **Twitter** | [iOS+](/docs/auth/ios/twitter-login) \\| [Android](/docs/auth/android/twitter-login) \\| [Web](/docs/auth/web/twitter-login) \\| [Flutter](/docs/auth/flutter/federated-auth#twitter) \\| [Unity](/docs/auth/unity/twitter-login) \\| [C++](/docs/auth/cpp/twitter-login) |\n| **Yahoo** | [iOS+](/docs/auth/ios/yahoo-oauth) \\| [Android](/docs/auth/android/yahoo-oauth) \\| [Web](/docs/auth/web/yahoo-oauth) \\| [Unity](/docs/auth/unity/yahoo-oauth) \\| [C++](/docs/auth/cpp/yahoo-oauth) |\n\nI want to build rich pre-sign-in experiences\n--------------------------------------------\n\nYou can enable users to use the signed-in features of your app before they\nactually sign in using **Anonymous Auth**. With anonymous \"sign-in\", you create\ntemporary single-session accounts, which you can use like a real account. Then,\nafter the user signs in or signs up, link the temporary account to the real\naccount to let them continue where they left off.\n\nAnonymous Auth works well alongside either Custom Auth or any of Firebase's\nauthentication services.\n\nSee the docs for\n[iOS+](/docs/auth/ios/anonymous-auth),\n[Android](/docs/auth/android/anonymous-auth),\n[Web](/docs/auth/web/anonymous-auth),\n[Flutter](/docs/auth/flutter/anonymous-auth),\n[Unity](/docs/auth/unity/anonymous-auth), or\n[C++](/docs/auth/cpp/anonymous-auth).\n\nI want to access Firebase services from my backend\n--------------------------------------------------\n\nTo access Firebase services from a server, you don't need to use\nFirebase Authentication. Instead, use the [Admin SDK](/docs/admin/setup). When you\ninitialize the Admin SDK, you authenticate with service account credentials,\nwhich represent your Firebase project rather than a particular user, and which\ngrant full access to your project's resources."]]