在 Identity Platform 上使用電話號碼登入使用者帳戶
本文說明如何使用 Identity Platform,透過電話號碼登入使用者帳戶。
事前準備
- 登入 Google Cloud 帳戶。如果您是 Google Cloud新手,歡迎 建立帳戶,親自評估產品在實際工作環境中的成效。新客戶還能獲得價值 $300 美元的免費抵免額,可用於執行、測試及部署工作負載。
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
- 啟用 Identity Platform。如要瞭解如何操作,請參閱快速入門導覽課程。
為 Identity Platform 啟用手機登入功能
前往「Identity Providers」(識別資訊提供者) 頁面。
在「Identity Providers」(身分識別提供者) 頁面上,按一下「Add a provider」(新增供應商)。
在「Select a provider」(選取提供者) 清單中,選取「 Phone」(電話)。
將「Enabled」(已啟用) 切換為開啟。
如要儲存提供者設定,請按一下「儲存」。
為應用程式平台設定手機登入功能
如果您使用 Identity Platform for Apple、Android 或網頁平台,也必須透過 Firebase 控制台設定應用程式。
適用於 Apple 平台:
- 為 Firebase 專案啟用電話號碼登入功能。
- 啟用無訊息推播通知,驗證應用程式。
如需操作說明,請參閱「在 Apple 平台上使用電話號碼透過 Firebase 驗證」。
Android 平台:
- 為 Firebase 專案啟用電話號碼登入功能。
- 使用 Play Integrity API 啟用應用程式驗證。
如需操作說明,請參閱「使用電話號碼在 Android 上透過 Firebase 進行驗證」。
網頁平台:
- 為 Firebase 專案啟用電話號碼登入功能。
- 設定 reCAPTCHA 驗證器。
如需操作說明,請參閱「使用 JavaScript 透過手機號碼向 Firebase 進行驗證」。
後續步驟
- 瞭解如何註冊測試電話號碼,以供開發用途。
- 瞭解如何使用簡訊區域限制 Identity Platform 簡訊驗證的使用情形。