Package google.cloud.identitytoolkit.v2

索引

AccountManagementService

Identity Toolkit 的帳戶管理

FinalizeMfaEnrollment

rpc FinalizeMfaEnrollment(FinalizeMfaEnrollmentRequest) returns (FinalizeMfaEnrollmentResponse)

為使用者註冊次要驗證方法。

授權範圍

需要下列其中一種 OAuth 範圍:

  • https://www.googleapis.com/auth/identitytoolkit
  • https://www.googleapis.com/auth/cloud-platform

詳情請參閱 Authentication Overview

StartMfaEnrollment

rpc StartMfaEnrollment(StartMfaEnrollmentRequest) returns (StartMfaEnrollmentResponse)

MFA 註冊程序的第一步。如果是簡訊,系統會傳送簡訊驗證碼給使用者。

授權範圍

需要下列其中一種 OAuth 範圍:

  • https://www.googleapis.com/auth/identitytoolkit
  • https://www.googleapis.com/auth/cloud-platform

詳情請參閱 Authentication Overview

WithdrawMfa

rpc WithdrawMfa(WithdrawMfaRequest) returns (WithdrawMfaResponse)

撤銷帳戶已註冊的其中一個雙重驗證方式。

授權範圍

需要下列其中一種 OAuth 範圍:

  • https://www.googleapis.com/auth/identitytoolkit
  • https://www.googleapis.com/auth/cloud-platform

詳情請參閱 Authentication Overview

AuthenticationService

Identity Toolkit 的驗證

FinalizeMfaSignIn

rpc FinalizeMfaSignIn(FinalizeMfaSignInRequest) returns (FinalizeMfaSignInResponse)

驗證多重身份驗證挑戰問題並執行登入作業

授權範圍

需要下列其中一種 OAuth 範圍:

  • https://www.googleapis.com/auth/identitytoolkit
  • https://www.googleapis.com/auth/cloud-platform

詳情請參閱 Authentication Overview

GetPasswordPolicy

rpc GetPasswordPolicy(GetPasswordPolicyRequest) returns (PasswordPolicy)

取得專案或租用戶的密碼政策設定組合。

授權範圍

需要下列其中一種 OAuth 範圍:

  • https://www.googleapis.com/auth/identitytoolkit
  • https://www.googleapis.com/auth/cloud-platform

詳情請參閱 Authentication Overview

GetRecaptchaConfig

rpc GetRecaptchaConfig(GetRecaptchaConfigRequest) returns (RecaptchaConfig)

取得 reCAPTCHA 分析所需的參數。

授權範圍

需要下列其中一種 OAuth 範圍:

  • https://www.googleapis.com/auth/identitytoolkit
  • https://www.googleapis.com/auth/cloud-platform

詳情請參閱 Authentication Overview

RevokeToken

rpc RevokeToken(RevokeTokenRequest) returns (RevokeTokenResponse)

從 Identity Provider (IdP) 撤銷使用者的權杖。方法是手動提供 IdP 憑證,以及要撤銷的權杖類型。

如要識別 Google Cloud 專案,請在要求中提供 API 金鑰

授權範圍

需要下列其中一種 OAuth 範圍:

  • https://www.googleapis.com/auth/identitytoolkit
  • https://www.googleapis.com/auth/cloud-platform

詳情請參閱 Authentication Overview

StartMfaSignIn

rpc StartMfaSignIn(StartMfaSignInRequest) returns (StartMfaSignInResponse)

傳送多重驗證挑戰

授權範圍

需要下列其中一種 OAuth 範圍:

  • https://www.googleapis.com/auth/identitytoolkit
  • https://www.googleapis.com/auth/cloud-platform

詳情請參閱 Authentication Overview

AutoRetrievalInfo

自動擷取簡訊所需的資訊。

欄位
app_signature_hash

string

Android 應用程式針對 Google Play 服務的 SMS Retriever API 所用的簽署雜湊。

ClientType

用戶端的平台類型:網頁、Android 或 iOS。

列舉
CLIENT_TYPE_UNSPECIFIED 未指定用戶端類型。
CLIENT_TYPE_WEB 用戶端類型為網頁。
CLIENT_TYPE_ANDROID 用戶端類型為 Android。
CLIENT_TYPE_IOS 用戶端類型為 ios。

FinalizeMfaEnrollmentRequest

為使用者註冊次要驗證方法。

欄位
id_token

string

這是必要旗標,ID 權杖。

display_name

string

使用者輸入的顯示名稱,用於區分相同或不同類型的第二種驗證方式。

tenant_id

string

使用者註冊 MFA 所屬的 Identity Platform 租用戶 ID。如果未設定,使用者就會屬於預設的 Identity Platform 專案。

聯集欄位 verification_info。需要驗證的多重驗證註冊資訊。verification_info 只能是下列其中一項:
phone_verification_info

FinalizeMfaPhoneRequestInfo

授權傳送簡訊進行電話驗證的驗證資訊。

totp_verification_info

FinalizeMfaTotpEnrollmentRequestInfo

TOTP 的驗證資訊。

FinalizeMfaEnrollmentResponse

FinalizeMfaEnrollment 回應。

欄位
id_token

string

ID 權杖已更新,反映多重身份驗證註冊狀態。

refresh_token

string

重新整理權杖,以反映多重身分驗證註冊狀態。

聯集欄位 auxiliary_auth_info。已驗證的多重驗證註冊資訊。auxiliary_auth_info 只能是下列其中一項:
phone_auth_info

FinalizeMfaPhoneResponseInfo

電話驗證專用的輔助驗證資訊。

totp_auth_info

FinalizeMfaTotpEnrollmentResponseInfo

專屬於 TOTP 驗證的輔助驗證資訊。

FinalizeMfaPhoneRequestInfo

FinalizeMfa 要求的電話驗證資訊。

欄位
session_info

string

代表註冊工作階段的不透明字串。

code

string

使用者輸入的驗證碼。

android_verification_proof

string

僅限 Android 裝置。透過 GmsCore 進行「即時」電話號碼驗證。

phone_number

string

如果提供 Android 驗證證明,就必須提供這項屬性。

FinalizeMfaPhoneResponseInfo

FinalizeMfa 回應的電話驗證資訊。

欄位
android_verification_proof

string

僅限 Android 裝置。針對與 Android 裝置綁定的有效程式碼,提供長效的替代方案。

android_verification_proof_expire_time

Timestamp

僅限 Android 裝置。驗證證明的到期時間 (以秒為單位)。

phone_number

string

請提供 Android 驗證證明。

FinalizeMfaSignInRequest

驗證多重驗證挑戰,完成登入程序。

欄位
mfa_pending_credential

string

這是必要旗標,第一層驗證機制登入的憑證尚未完成。

tenant_id

string

使用者要登入的 Identity Platform 租用戶 ID。如果未設定,使用者會登入預設的 Identity Platform 專案。

mfa_enrollment_id

string

使用者目前多重驗證註冊項目清單中的多重驗證註冊 ID。

聯集欄位 verification_info。完成 MFA 挑戰的證明。verification_info 只能是下列其中一項:
phone_verification_info

FinalizeMfaPhoneRequestInfo

完成簡訊多重驗證挑戰的證明。

totp_verification_info

MfaTotpSignInRequestInfo

證明已完成 TOTP 式 MFA 挑戰。

FinalizeMfaSignInResponse

FinalizeMfaSignIn 回應。

欄位
id_token

string

已驗證使用者的 ID 權杖。

refresh_token

string

已驗證使用者的權杖重新整理。

聯集欄位 auxiliary_auth_info。多重驗證 (MFA) 已驗證登入資訊。auxiliary_auth_info 只能是下列其中一項:
phone_auth_info

FinalizeMfaPhoneResponseInfo

額外的手機驗證資訊,包括 Android 驗證證明。

FinalizeMfaTotpEnrollmentRequestInfo

針對 FinalizeMfa 的 TOTP 驗證,特定的 MFA 要求資訊。

欄位
session_info

string

代表註冊工作階段的不透明字串。

verification_code

string

使用者輸入的驗證碼。

FinalizeMfaTotpEnrollmentResponseInfo

這個類型沒有任何欄位。

針對 FinalizeMfa 的 TOTP 驗證,專屬的 MFA 回應資訊。

GetPasswordPolicyRequest

GetPasswordPolicy 的要求。

欄位
tenant_id

string

租戶的 ID。

GetRecaptchaConfigRequest

GetRecaptchaConfig 的要求。

欄位
tenant_id

string

租戶的 ID。

client_type

ClientType

reCAPTCHA Enterprise 會為不同用戶端類型使用不同的網站金鑰。指定用戶端類型,以取得對應的鍵。

version

RecaptchaVersion

reCAPTCHA 版本。

MfaTotpSignInRequestInfo

FinalizeMfaSignInRequest 的 TOTP 驗證資訊。

欄位
verification_code

string

使用者輸入的驗證碼。

PasswordPolicy

密碼政策的設定。

欄位
custom_strength_options

CustomStrengthOptions

密碼政策強制執行的自訂強度選項。

schema_version

int32

僅供輸出。密碼政策的結構定義版本號碼

allowed_non_alphanumeric_characters[]

string

僅供輸出。符合 non_alphanumeric 規定的字元。

enforcement_state

EnforcementState

僅供輸出。密碼政策要使用的強制執行模式。

force_upgrade_on_signin

bool

使用者必須使用符合密碼政策的密碼才能登入。

CustomStrengthOptions

強制使用者密碼採用的自訂強度選項。

欄位
min_password_length

int32

密碼長度下限。範圍為 6 到 30

max_password_length

int32

密碼長度上限。沒有預設長度上限

contains_lowercase_character

bool

密碼必須包含小寫字元。

contains_uppercase_character

bool

密碼必須包含大寫字元。

contains_numeric_character

bool

密碼必須包含數字。

contains_non_alphanumeric_character

bool

密碼必須包含非英數字元。

EnforcementState

密碼政策的強制執行狀態

列舉
ENFORCEMENT_STATE_UNSPECIFIED 未設定強制執行狀態。
OFF 專案不會使用密碼政策。
ENFORCE 系統會拒絕不符合密碼政策的密碼,並擲回錯誤。

RecaptchaConfig

reCAPTCHA 設定

欄位
recaptcha_enforcement_state[]

RecaptchaEnforcementState

GCIP 支援 reCAPTCHA 保護的提供者 reCAPTCHA 強制執行狀態。

recaptcha_key

string

reCAPTCHA Enterprise 金鑰資源名稱,例如「projects/{project}/keys/{key}」。只有在至少一個 reCAPTCHA 供應商的 reCAPTCHA 強制執行狀態為「稽核」或「強制執行」時,系統才會傳回這個值。

use_sms_bot_score

bool

是否要為 reCAPTCHA 電話服務供應商使用 rCE 機器人分數。

use_sms_toll_fraud_protection

bool

是否要為 reCAPTCHA 電話供應商使用 rCE 簡訊費用詐欺防護風險分數。

RecaptchaEnforcementState

reCAPTCHA 防護機制的強制執行狀態。

欄位
provider

RecaptchaProvider

提供 reCAPTCHA 保護的供應商。

enforcement_state

EnforcementState

提供者的 reCAPTCHA 強制執行狀態。

EnforcementState

每個提供者的 reCAPTCHA 保護措施強制執行狀態。

列舉
ENFORCEMENT_STATE_UNSPECIFIED 未設定強制執行狀態。
OFF 未強制執行。
AUDIT 建立 reCAPTCHA 評估,但不會使用結果強制執行。
ENFORCE 建立 reCAPTCHA 評估,並使用結果強制執行。

RecaptchaProvider

支援 reCAPTCHA 防護機制的 GCIP 供應商。

列舉
RECAPTCHA_PROVIDER_UNSPECIFIED 未指定 reCAPTCHA 供應商
EMAIL_PASSWORD_PROVIDER 電子郵件密碼供應者
PHONE_PROVIDER 電話驗證服務供應器

RecaptchaVersion

reCAPTCHA 版本。

列舉
RECAPTCHA_VERSION_UNSPECIFIED 未指定 reCAPTCHA 版本。
RECAPTCHA_ENTERPRISE reCAPTCHA Enterprise。

RevokeTokenRequest

RevokeToken 的要求訊息。

欄位
provider_id

string

這是必要旗標,權杖的 IDp 供應工具。目前僅支援 Apple IdP。格式應為「apple.com」。

token_type

TokenType

這是必要旗標,要撤銷的權杖類型。

token

string

這是必要旗標,要撤銷的權杖。如果傳入授權碼,API 會先將這組驗證碼換成存取權杖,然後撤銷已交換的權杖。

id_token

string

這是必要旗標,有效的 Identity Platform ID 權杖,用於連結帳戶。如果帳戶上有成功的符記撤銷要求,且撤銷後未產生任何符記,系統會立即忽略並傳回重複要求。

tenant_id

string

使用者要登入的 Identity Platform 租用戶 ID。如果未設定,使用者會登入預設的 Identity Platform 專案。

redirect_uri

string

用戶端向 IdP 提出的初始授權要求中提供的重新導向 URI。URI 必須採用 HTTPS 通訊協定、包含網域名稱,且不得包含 IP 位址或 localhost。如果 token_type 是 CODE,則為必要屬性。

TokenType

要撤銷的權杖類型。

列舉
TOKEN_TYPE_UNSPECIFIED 預設值,請勿使用。
REFRESH_TOKEN 權杖類型為 refresh_token。
ACCESS_TOKEN 權杖類型為 access_token。
CODE 符記類型為 authorization_code。

RevokeTokenResponse

這個類型沒有任何欄位。

RevokeToken 的回應訊息。目前為空白。

StartMfaEnrollmentRequest

為使用者傳送多重驗證註冊驗證簡訊。

欄位
id_token

string

這是必要旗標,使用者的 ID 權杖。

tenant_id

string

使用者註冊 MFA 所屬的 Identity Platform 租用戶 ID。如果未設定,使用者就會屬於預設的 Identity Platform 專案。

聯集欄位 enrollment_info。按 2 級驗證類型區分的多重驗證資訊。enrollment_info 只能是下列其中一項:
phone_enrollment_info

StartMfaPhoneRequestInfo

授權傳送簡訊進行電話驗證的驗證資訊。

totp_enrollment_info

StartMfaTotpEnrollmentRequestInfo

專屬於 TOTP 驗證的登入資訊。

StartMfaEnrollmentResponse

StartMfaEnrollment 回應。

欄位
聯集欄位 enrollment_response。根據 2 因素驗證類型,回應 MFA 開始註冊的結果。enrollment_response 只能是下列其中一項:
phone_session_info

StartMfaPhoneResponseInfo

授權傳送簡訊進行電話驗證的驗證資訊。

totp_session_info

StartMfaTotpEnrollmentResponseInfo

針對 TOTP 驗證的註冊回應資訊。

StartMfaPhoneRequestInfo

StartMfa 要求的應用程式驗證資訊。

欄位
phone_number

string

註冊作業的必要項目,要註冊為多重身份驗證的電話號碼。

ios_receipt

string

僅限 iOS。透過 APNS 成功驗證應用程式權杖。

ios_secret

string

僅限 iOS。透過 APNS 傳送至 iOS 應用程式的密鑰。

recaptcha_token

string

僅限網頁版。reCAPTCHA 解決方案。

auto_retrieval_info

AutoRetrievalInfo

僅限 Android 裝置。Google Play 服務會使用這項參數,識別要自動擷取的應用程式。

safety_net_token

string

僅限 Android 裝置。用於代替 recaptcha 權杖,宣告應用程式身分。您可以透過 SafetyNet Android Attestation API 產生 SafetyNet 權杖,並將 phone_number 欄位的 Base64 編碼做為 Nonce。

play_integrity_token

string

僅限 Android 裝置。用於驗證應用程式身分,取代 recaptcha 權杖 (或 safety net 權杖)。您可以透過 PlayIntegrity API 產生 Play Integrity 權杖,方法是將 SHA256 套用至 phone_number 欄位做為 Nonce。

captcha_response

string

reCAPTCHA 用戶端整合功能提供的 reCAPTCHA Enterprise 權杖。啟用 reCAPTCHA Enterprise 時必須提供。

client_type

ClientType

用戶端類型 (網頁、Android 或 iOS)。啟用 reCAPTCHA Enterprise 時必須提供。

recaptcha_version

RecaptchaVersion

captcha_response 中 reCAPTCHA 權杖的 reCAPTCHA 版本。啟用 reCAPTCHA Enterprise 時必須提供。

StartMfaPhoneResponseInfo

StartMfa 回應的電話驗證資訊。

欄位
session_info

string

代表註冊工作階段的不透明字串。

StartMfaSignInRequest

傳送多重驗證挑戰,啟動多重驗證登入程序。

欄位
mfa_pending_credential

string

這是必要旗標,第一層驗證機制登入的憑證尚未完成。

mfa_enrollment_id

string

這是必要旗標,使用者目前多重驗證註冊項目清單中的多重驗證註冊 ID。

tenant_id

string

使用者要登入的 Identity Platform 租用戶 ID。如果未設定,使用者會登入預設的 Identity Platform 專案。

聯集欄位 sign_in_info。按 2 級驗證類型區分的多重驗證資訊。sign_in_info 只能是下列其中一項:
phone_sign_in_info

StartMfaPhoneRequestInfo

授權傳送簡訊進行電話驗證的驗證資訊。

StartMfaSignInResponse

StartMfaSignIn 回應。

欄位
聯集欄位 response_info。多重驗證開始登入回應,並根據第 2 種驗證類型進行驗證。response_info 只能是下列其中一項:
phone_response_info

StartMfaPhoneResponseInfo

專屬於簡訊類型第二因素的多重驗證登入工作階段資訊。除了從傳送的簡訊中擷取的一次性驗證碼外,您也應將這個工作階段資訊的內容傳送至 FinalizeMfaSignIn,以便完成登入程序。

StartMfaTotpEnrollmentRequestInfo

這個類型沒有任何欄位。

針對 StartMfa 的 TOTP 驗證,提供專屬的多重身份驗證要求資訊。

StartMfaTotpEnrollmentResponseInfo

針對 StartMfa 的 TOTP 驗證機制,專屬的 MFA 回應資訊。

欄位
shared_secret_key

string

代表共用 TOTP 密鑰的 base 32 編碼字串。

以 32 為基數的編碼是 RFC4648#section-6 所指定的編碼。(這與 RFC3548#section-5 中的基底 32 編碼相同)。

verification_code_length

int32

需要產生的驗證碼長度。

hashing_algorithm

string

用於產生驗證碼的雜湊演算法。

period_sec

int32

驗證碼變更的時間長度,單位為秒。

session_info

string

代表註冊工作階段的編碼字串。

finalize_enrollment_time

Timestamp

註冊作業必須完成的時間。

WithdrawMfaRequest

撤銷 MFA。

欄位
id_token

string

這是必要旗標,使用者的 ID 權杖。

mfa_enrollment_id

string

這是必要旗標,目前多重驗證註冊作業的多重驗證註冊 ID。

tenant_id

string

使用者取消註冊 MFA 所屬的 Identity Platform 租用戶 ID。如果未設定,使用者就會屬於預設的 Identity Platform 專案。

WithdrawMfaResponse

撤銷 MultiFactorAuth 回應。

欄位
id_token

string

ID 權杖已更新,反映次要驗證方式的移除情形。

refresh_token

string

已更新重新整理權杖,以反映次要驗證方式的移除作業。