初始設定
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
開發人員設定
啟用 Cloud 專案的 API 套件
- 前往 Cloud 控制台:https://console.cloud.google.com/。
- 選取現有的雲端專案或建立新專案。
- 前往
APIs & Services > Enable APIs and Services
。
- 搜尋「Chrome」。
- 選取「Chrome Management API」。
- 熟悉《服務條款》。
- 按一下「
Enable
」。
建立憑證
替代方法 1:OAuth 2.0 用戶端 ID
- 您必須先使用應用程式相關資訊設定 OAuth 同意畫面,才能建立「OAuth 2.0 用戶端 ID」。前往 Cloud 控制台中的
APIs & Services > OAuth consent screen
。
請在同意畫面設定頁面中輸入範圍:
- 針對 Reports API 新增:
https://www.googleapis.com/auth/chrome.management.reports.readonly
- 針對 App Details API 新增:
https://www.googleapis.com/auth/chrome.management.appdetails.readonly
- 針對 Telemetry API 新增:
https://www.googleapis.com/auth/chrome.management.telemetry.readonly
請注意,新增的範圍是敏感資訊,因此您可能需要將應用程式送交驗證。否則,如果您的應用程式不是內部應用程式,使用者可能會看到安全性警告畫面。
前往 APIs & Services > Credentials > Create Credentials > OAuth client ID
並按照步驟建立憑證。
或者,您也可以在 OAuth Playground 中測試應用程式 (請參閱操作說明)。
替代方法 2:服務帳戶
- 前往
APIs & Services > Credentials > Create Credentials > Service account
。
- 輸入服務帳戶名稱,然後按一下「
Create
」。
- 為服務帳戶建立金鑰。按一下
Add Key
並建立「json」金鑰。請將檔案記錄在安全的位置。
- 使用具備適當的客戶管理員權限的服務帳戶:
- 「客戶」可以設定全網域委派功能,然後服務帳戶就能模擬擁有適當權限的使用者/管理員 (請參閱做法)
- 或客戶可將具備適當權限的管理員角色直接授予服務帳戶 (請參閱操作說明)。
為客戶進行設定
客戶管理員會根據開發人員建立的應用程式類型,使用不同的設定選項。
「OAuth 2.0 用戶端」應用程式
無需進行特殊設定。
應用程式使用者需要適當的管理員權限 (請參閱操作說明)。
應用程式使用者必須同意應用程式 OAuth 彈出式同意畫面。您也可以允許這個應用程式使用全網域委派功能 (請參閱做法),這樣會略過使用者的 OAuth 彈出式同意畫面。
視需要確認應用程式是否未遭到封鎖或明確信任應用程式 (請參閱方法)。
「服務帳戶」應用程式
服務帳戶必須取得適當的管理員權限。您可以選擇下列其中一種操作方式:
- 允許全網域委派功能,讓服務帳戶可模擬擁有適當權限的管理員 (請參閱方法)。
- 直接授予服務帳戶的管理員角色 (請參閱操作說明)。
使用說明指南
如何封鎖或信任應用程式
- 以客戶管理員身分前往管理控制台 (https://admin.google.com/)。
- 前往
Security > Access and data control > API controls
。
- 在
App access control
部分中,按一下 Manage third party app access
。
- 如果在「已連結的應用程式」清單中找不到該應用程式,可以設定新的應用程式。
- 您現在可以封鎖應用程式,或明確信任應用程式。
如何啟用全網域委派功能
- 以客戶管理員身分前往管理控制台 (https://admin.google.com/)。
- 前往
Security > Access and data control > API controls > Domain-wide delegation
。
- 按一下「
Add new
」。
- 輸入用戶端 ID (「服務帳戶專屬 ID」或「應用程式用戶端 ID」)。
- 輸入所有必要的 OAuth 範圍。視應用程式而定,您可能還需要輸入 Chrome Management API 的範圍 (例如透過 Directory API 管理裝置、使用者、瀏覽器、機構單位、群組等)。
- 按一下「
Authorize
」。
如何管理管理員權限
而對於 Chrome Management API 的不同部分,就需要不同的管理員權限。請參閱 Reports API、App Details API 或 Telemetry API 所需的管理員權限。
如何授予權限:
- 以客戶管理員身分前往管理控制台 (https://admin.google.com/)。
- 前往「
Admin roles
」頁面。
- 找出現有的角色,或是建立具備必要權限的新角色。
- 請將這個角色指派給使用者電子郵件地址或服務帳戶電子郵件地址。
如何在 OAuth Playground 中測試應用程式
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[[["\u003cp\u003eDevelopers need to enable the Chrome Management API, create credentials (OAuth or Service Account), and understand setup options for customer admins.\u003c/p\u003e\n"],["\u003cp\u003eCustomer admins need to configure settings based on the developer's application type, potentially granting privileges or enabling domain-wide delegation.\u003c/p\u003e\n"],["\u003cp\u003e"How to" guides provide detailed instructions for blocking/trusting apps, enabling domain-wide delegation, managing admin privileges, and testing in OAuth Playground.\u003c/p\u003e\n"],["\u003cp\u003eDifferent Chrome Management APIs require specific admin privileges, and detailed information is available in their respective guides.\u003c/p\u003e\n"],["\u003cp\u003eOAuth 2.0 Client apps need user consent or Domain-Wide Delegation, while Service Account apps require explicit admin privilege grants.\u003c/p\u003e\n"]]],[],null,["# Initial Setup\n\nSetup for a developer\n---------------------\n\n### Enable API suite for cloud project\n\n- Navigate to Cloud Console: \u003chttps://console.cloud.google.com/\u003e.\n- Select existing cloud project or create a new one.\n- Go to `APIs & Services \u003e Enable APIs and Services`.\n- Search for \"Chrome\".\n- Select \"Chrome Management API\".\n- Familiarize yourself with Terms of Service.\n- Click `Enable`.\n\n### Create Credentials\n\n#### Alternative 1: OAuth 2.0 Client IDs\n\n- Before you are able to create \"OAuth 2.0 Client ID\" you need to first configure the OAuth consent screen with information about your application. In Cloud Console, go to `APIs & Services \u003e OAuth consent screen`.\n- In your consent screen config page, enter the scopes:\n\n - For Reports API add: `https://www.googleapis.com/auth/chrome.management.reports.readonly`\n - For App Details API add: `https://www.googleapis.com/auth/chrome.management.appdetails.readonly`\n - For Telemetry API add: `https://www.googleapis.com/auth/chrome.management.telemetry.readonly`\n\n Note that added scopes are sensitive, so you may need to submit your app for verification. Otherwise, users may see a security warning screen if your app is not internal.\n- Go to `APIs & Services \u003e Credentials \u003e Create Credentials \u003e OAuth client ID` and follow the steps to create the credentials.\n\n- Optionally, test your app in OAuth Playground (see [How to](#how_to_test_your_app_in_oauth_playground)).\n\n#### Alternative 2: Service Account\n\n- Go to `APIs & Services \u003e Credentials \u003e Create Credentials \u003e Service account`.\n- Enter service account name and click `Create`.\n- Create a key for your service account. Click `Add Key` and create \"json\" key. Keep track of the file in a secure location.\n- Use your service account with proper admin privileges for customer:\n - Customer may set up Domain-Wide Delegation and then the service account can impersonate a user/admin who has proper privileges (see [how](#how_to_enable_domain-wide_delegation))\n - or customer may grant an admin role with proper privileges to the service account directly (see [how](#how_to_manage_admin_privileges)).\n\nSetup for a customer\n--------------------\n\nDepending on which application type the developer created, the customer admin has different setup options.\n\n#### \"OAuth 2.0 Client\" Apps\n\nNo special setup is needed.\n\nApp users require proper admin privileges (see [how](#how_to_manage_admin_privileges)).\n\nApp users need to agree to the app OAuth pop-up consent screen.\nOptionally, you can allow this app to use Domain-Wide Delegation (see [how](#how_to_enable_domain-wide_delegation)), which will omit the OAuth pop-up consent screen for users.\n\nOptionally verify if the app isn't blocked, or trust the app explicitly (see [how](#how_to_block_or_trust_an_app)).\n\n#### \"Service Account\" Apps\n\nThe service account must be granted proper admin privileges.\nYou can do this in either of two ways:\n\n- Allow Domain-Wide Delegation so the Service Account can impersonate an admin that has proper privileges (see [how](#how_to_enable_domain-wide_delegation)).\n- Grant Admin Roles for the service account directly (see [how](#how_to_manage_admin_privileges)).\n\n\"How to\" guides\n---------------\n\n### How to block or trust an app\n\n- As customer admin, go to Admin Console (https://admin.google.com/).\n- Navigate to `Security \u003e Access and data control \u003e API controls`.\n- In the `App access control` section, click `Manage third party app access`.\n- If you don't see the app in the 'Connected apps' list, you can configure a new app.\n- You can now block the app or trust the app explicitly.\n\n### How to enable domain-wide delegation\n\n- As customer admin, go to Admin Console (https://admin.google.com/).\n- Navigate to `Security \u003e Access and data control \u003e API controls \u003e Domain-wide delegation`.\n- Click `Add new`.\n- Enter client ID (\"service account unique id\" or \"app client ID\").\n- Enter all necessary OAuth scopes. Depending on the app, you may need to enter scopes for more than just Chrome Management API; e.g. the Directory API for managing devices, users, browsers, OUs, groups, etc.\n- Click `Authorize`.\n\n### How to manage admin privileges\n\nFor different portions of the Chrome Management APIs, different admin privileges\nare needed. See which admin privileges are required for\n[Reports API](/chrome/management/guides/reports_api),\n[App Details API](/chrome/management/guides/app_details_api), or\n[Telemetry API](/chrome/management/guides/telemetry_api).\n\nTo grant privileges:\n\n- As customer admin, go to Admin Console (https://admin.google.com/).\n- Navigate to `Admin roles` page.\n- Find an existing role or create a new role with the necessary privileges.\n- Assign this role to the user email address or the service account email address.\n\n### How to test your app in OAuth Playground\n\n- In Cloud Console, when creating an OAuth client ID for your app (see above [OAuth 2.0 Client IDs](/chrome/management/guides/setup#alternative_1_oauth_20_client_ids) section) select application type \"Web Applications\".\n- Enter a 'Name'.\n- To test your app, add `https://developers.google.com/oauthplayground` to the \"Authorized redirect URIs\" field. You can remove the redirect URI from your app when you're done testing.\n- Click `Create` and copy \"client ID\" and \"client secret\".\n- Go to [OAuth Playground](https://developers.google.com/oauthplayground/)\n- Click the gear icon in the top right corner ('OAuth 2.0 Configuration'), select `Use your own OAuth credentials`, and enter \"OAuth Client ID\" and \"OAuth Client secret\".\n- Follow these steps in OAuth Playground\n\n - Select \\& authorize APIs.\n\n Add `https://www.googleapis.com/auth/chrome.management.reports.readonly` (or other api scope) in the scope input field and click 'Authorize APIs'.\n Authorize using a customer admin account. Agree to the terms.\n - Exchange authorization code for tokens.\n\n Click `Exchange authorization code for tokens`. Optionally, click `Auto-refresh the token before it expires`.\n - Configure request to API.\n\n Enter your API URL in the 'Request URI' text box. Modify 'HTTP Method', 'Enter request body', etc. as per the API specification.\n For example, use the following URL to count the installed Apps in your organization: `https://chromemanagement.googleapis.com/v1alpha1/customers/my_customer/reports:countInstalledApps`"]]