兩步驟驗證
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
Google Ads 授權支援在 Google Ads 帳戶中啟用兩步驟驗證。下表列出啟用兩步驟驗證的三種情況。
使用者在自己的 Google 帳戶中啟用兩步驟驗證
|
使用者可能會自行決定為 Google 帳戶開啟兩步驟驗證功能。
啟用兩步驟驗證後
在 OAuth2 驗證流程中,Google 會先提示使用者進行兩步驟驗證,再核發更新權杖。發出更新權杖後,即可用於產生 API 呼叫所需的存取權杖。
先前的更新權杖
使用者啟用兩步驟驗證後,在啟用前核發的重新整理權杖仍有效。更新權杖可照常發出有效的存取權杖。
|
管理員要求 Google Ads 帳戶使用者在 Google 帳戶中啟用兩步驟驗證
|
帳戶管理員可以要求共用 Google Ads 帳戶的所有使用者,都必須在 Google 帳戶中啟用兩步驟驗證。
使用者啟用兩步驟驗證
在 OAuth2 驗證流程中,Google 會先提示使用者進行兩步驟驗證,再核發更新權杖。發出更新權杖後,即可用於產生 API 呼叫所需的存取權杖。
使用者未啟用兩步驟驗證
在驗證流程中,使用者不會看到兩步驟驗證提示。這項體驗與 Google Ads 帳戶的任何設定無關。
發放後,更新權杖可用於發放存取權杖。不過,在使用者於 Google 帳戶中啟用兩步驟驗證前,使用這個存取權杖發出的 API 呼叫都會失敗,並顯示
TWO_STEP_VERIFICATION_NOT_ENROLLED 錯誤。
先前的更新權杖
這項規則也適用於兩步驟驗證規定生效前核發的重新整理權杖。重新整理權杖可用於產生存取權杖,但如果使用者未在 Google 帳戶中啟用兩步驟驗證,使用這些存取權杖發出的 API 呼叫會失敗,並顯示
TWO_STEP_VERIFICATION_NOT_ENROLLED
錯誤。
|
Google 要求 Google Ads 帳戶的所有使用者,都必須在 Google 帳戶中啟用兩步驟驗證。{:#require-2-step}
|
在某些情況下,Google 可能會要求 Google Ads 帳戶的所有使用者,都必須在 Google 帳戶中啟用兩步驟驗證。
啟用兩步驟驗證後
在 OAuth2 驗證流程中,Google 會先提示使用者進行兩步驟驗證,再核發更新權杖。無論 Google 是否選擇讓 Google Ads 帳戶要求所有使用者啟用雙重驗證,都會提供這項體驗。
發出更新權杖後,即可照常使用該權杖產生 API 呼叫所需的存取權杖。
先前的更新權杖
使用者啟用兩步驟驗證後,在啟用前核發的重新整理權杖仍有效。更新權杖可照常核發有效的存取權杖。
使用這個存取權杖發出的 API 呼叫不會遇到 TWO_STEP_VERIFICATION_NOT_ENROLLED 錯誤,因為兩步驟驗證是 Google 啟用的,而不是 Google Ads 帳戶管理員。
|
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-27 (世界標準時間)。
[null,null,["上次更新時間:2025-08-27 (世界標準時間)。"],[[["\u003cp\u003eGoogle Ads authorization supports enabling 2-Step Verification for enhanced security, impacting how refresh and access tokens function.\u003c/p\u003e\n"],["\u003cp\u003eUsers voluntarily enabling 2-Step Verification or being required to by administrators or Google will encounter a 2-Step Verification prompt during authentication.\u003c/p\u003e\n"],["\u003cp\u003eIf an administrator requires 2-Step Verification, API calls will fail with an error until it's enabled, even with existing refresh tokens.\u003c/p\u003e\n"],["\u003cp\u003eRefresh tokens issued before enabling 2-Step Verification generally remain valid but may be subject to the specific scenario and enforcement level.\u003c/p\u003e\n"],["\u003cp\u003eGoogle enforcing 2-Step Verification differs from administrator enforcement, as API calls with existing refresh tokens won't encounter the \u003ccode\u003eTWO_STEP_VERIFICATION_NOT_ENROLLED\u003c/code\u003e error.\u003c/p\u003e\n"]]],[],null,["# 2-Step Verification\n\nGoogle Ads authorization supports enabling [2-Step Verification on your Google Ads\naccount](//support.google.com/google-ads/answer/12864186). The following table\npresents the three scenarios for enabling 2-Step Verification.\n\n|-----------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ### User turns on 2-Step Verification on their own Google Account | *A user might decide on their own to turn on 2-Step Verification for their Google Account.* #### After 2-Step Verification is enabled During the [OAuth2 authentication flow](/google-ads/api/docs/oauth/client-library), Google prompts the user for 2-Step Verification before issuing a refresh token. Once issued, the refresh token can be used to generate the access token needed in API calls. #### Previous refresh tokens A refresh token that was issued before the user enabled 2-Step Verification remains valid after the user enables 2-Step Verification. The refresh token can be used to issue valid access tokens as usual. |\n| ### Administrator requires users of a Google Ads account to enable 2-Step Verification on their Google Account | *An account administrator can require all users of a Google Ads account to [enable 2-Step Verification](https://support.google.com/google-ads/answer/12865295) on their Google Account.* #### User enables 2-Step Verification During the [OAuth2 authentication flow](/google-ads/api/docs/oauth/client-library), Google prompts the user for 2-Step Verification before issuing a refresh token. Once issued, the refresh token can be used to generate the access token needed in API calls. #### User doesn't enable 2-Step Verification During the authentication flow, the user won't see the 2-Step Verification prompt. This experience is independent of any settings on the Google Ads account. Once issued, the refresh token can be used to issue access tokens. However, the API calls made using this access token will fail with a [`TWO_STEP_VERIFICATION_NOT_ENROLLED`](/google-ads/api/reference/rpc/v21/AuthenticationErrorEnum.AuthenticationError#two_step_verification_not_enrolled) error until the user enables 2-Step Verification in their Google Account. ##### Previous refresh tokens This rule applies to refresh tokens issued prior to the 2-Step Verification requirement as well---the refresh token can be used to generate access tokens, but API calls made with these access tokens will fail with a [`TWO_STEP_VERIFICATION_NOT_ENROLLED`](/google-ads/api/reference/rpc/v21/AuthenticationErrorEnum.AuthenticationError#two_step_verification_not_enrolled) error until the user enables 2-Step Verification in their Google Account. |\n| ### Google requires all users of a Google Ads account to opt in to 2-step verification on their Google Account {:#require-2-step} | *In some cases, Google might require all users of a Google Ads account to enable 2-step verification on their Google Account.* #### After 2-Step Verification is enabled During the [OAuth2 authentication flow](/google-ads/api/docs/oauth/client-library), Google prompts the user for 2-Step Verification before issuing a refresh token. This experience is independent of whether Google opted in the Google Ads account to require all its users to enable 2-factor verification. Once issued, the refresh token can be used to generate the access token needed in API calls as usual. #### Previous refresh tokens A refresh token that was issued before the user enabled 2-Step Verification remains valid after the user enables 2-Step Verification. The refresh token can be used to issue a valid access token as usual. API calls made using this access token won't encounter the `TWO_STEP_VERIFICATION_NOT_ENROLLED` error because the 2-Step Verification opt-in was initiated by Google and not by the Google Ads account administrator. |"]]