Thiết lập ban đầu
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Thiết lập dành cho nhà phát triển
Bật bộ API cho dự án trên đám mây
- Chuyển đến Cloud Console: https://console.cloud.google.com/.
- Chọn dự án hiện có trên đám mây hoặc tạo một dự án mới.
- Chuyển đến
APIs & Services > Enable APIs and Services
.
- Tìm kiếm "Chrome".
- Chọn "API Quản lý Chrome".
- Tìm hiểu Điều khoản dịch vụ.
- Nhấp vào
Enable
.
Tạo thông tin xác thực
Lựa chọn 1: Mã ứng dụng khách OAuth 2.0
- Để có thể tạo "Mã ứng dụng khách OAuth 2.0", trước tiên, bạn cần định cấu hình màn hình xin phép bằng OAuth với thông tin về ứng dụng của mình.
Trong Cloud Console, hãy chuyển đến
APIs & Services > OAuth consent screen
.
Trong trang cấu hình màn hình đồng ý, hãy nhập các phạm vi:
- Đối với API Báo cáo, hãy thêm:
https://www.googleapis.com/auth/chrome.management.reports.readonly
- Đối với API Chi tiết ứng dụng, hãy thêm:
https://www.googleapis.com/auth/chrome.management.appdetails.readonly
- Đối với API Telemetry, hãy thêm:
https://www.googleapis.com/auth/chrome.management.telemetry.readonly
Xin lưu ý rằng phạm vi mà bạn thêm có tính chất nhạy cảm, vì vậy, bạn có thể cần phải gửi ứng dụng của mình để xác minh. Nếu không, người dùng có thể thấy màn hình cảnh báo bảo mật nếu ứng dụng của bạn không phải là ứng dụng nội bộ.
Hãy truy cập vào APIs & Services > Credentials > Create Credentials > OAuth client ID
rồi làm theo các bước để tạo thông tin đăng nhập.
Bạn có thể kiểm thử ứng dụng của mình trong OAuth Playground (xem phần Hướng dẫn nếu muốn).
Lựa chọn 2: Tài khoản dịch vụ
- Chuyển đến
APIs & Services > Credentials > Create Credentials > Service account
.
- Nhập tên tài khoản dịch vụ rồi nhấp vào
Create
.
- Tạo khoá cho tài khoản dịch vụ của bạn. Nhấp vào
Add Key
rồi tạo khoá "json". Theo dõi tệp đó ở vị trí an toàn.
- Sử dụng tài khoản dịch vụ của bạn với các đặc quyền thích hợp của quản trị viên cho khách hàng:
- Khách hàng có thể thiết lập Ủy quyền trên toàn miền, sau đó tài khoản dịch vụ có thể mạo danh người dùng/quản trị viên có đặc quyền thích hợp (xem cách thực hiện)
- hoặc khách hàng có thể cấp trực tiếp vai trò quản trị viên có đặc quyền thích hợp cho tài khoản dịch vụ (xem cách thực hiện).
Thiết lập cho khách hàng
Tuỳ thuộc vào loại ứng dụng mà nhà phát triển tạo, quản trị viên của khách hàng sẽ có những chế độ thiết lập khác nhau.
Ứng dụng "Ứng dụng OAuth 2.0"
Bạn không cần phải thiết lập đặc biệt.
Người dùng ứng dụng yêu cầu đặc quyền phù hợp của quản trị viên (xem cách thực hiện).
Người dùng ứng dụng cần đồng ý với màn hình xin phép bật lên OAuth của ứng dụng.
Bạn có thể tuỳ ý cho phép ứng dụng này sử dụng tính năng Ủy quyền trên toàn miền (xem cách thực hiện). Thao tác này sẽ bỏ qua màn hình đồng ý bật lên của OAuth cho người dùng.
Xác minh xem ứng dụng có bị chặn hay không hoặc tin tưởng ứng dụng một cách rõ ràng (xem cách thực hiện) (không bắt buộc).
Các ứng dụng "Tài khoản dịch vụ"
Tài khoản dịch vụ phải được cấp các đặc quyền thích hợp của quản trị viên.
Bạn có thể thực hiện việc này theo một trong hai cách:
- Cho phép uỷ quyền trên toàn miền để Tài khoản dịch vụ có thể mạo danh một quản trị viên có đặc quyền thích hợp (xem cách thực hiện).
- Cấp trực tiếp vai trò quản trị viên cho tài khoản dịch vụ (xem cách thực hiện).
Hướng dẫn "Cách thực hiện"
Cách chặn hoặc tin cậy một ứng dụng
- Là quản trị viên của khách hàng, hãy truy cập vào Bảng điều khiển dành cho quản trị viên (https://admin.google.com/).
- Chuyển đến
Security > Access and data control > API controls
.
- Trong phần
App access control
, hãy nhấp vào Manage third party app access
.
- Nếu không thấy ứng dụng trong danh sách "Ứng dụng đã kết nối", bạn có thể định cấu hình một ứng dụng mới.
- Giờ đây, bạn có thể chặn ứng dụng hoặc tin tưởng ứng dụng một cách rõ ràng.
Cách bật tính năng uỷ quyền trên toàn miền
- Là quản trị viên của khách hàng, hãy truy cập vào Bảng điều khiển dành cho quản trị viên (https://admin.google.com/).
- Chuyển đến
Security > Access and data control > API controls > Domain-wide delegation
.
- Nhấp vào
Add new
.
- Nhập mã ứng dụng khách ("mã khách hàng duy nhất của tài khoản dịch vụ" hoặc "mã ứng dụng khách ứng dụng").
- Nhập tất cả phạm vi OAuth cần thiết. Tuỳ thuộc vào ứng dụng, có thể bạn sẽ cần phải nhập các phạm vi khác ngoài API Quản lý Chrome, chẳng hạn như API thư mục để quản lý thiết bị, người dùng, trình duyệt, đơn vị tổ chức, nhóm, v.v.
- Nhấp vào
Authorize
.
Cách quản lý đặc quyền của quản trị viên
Đối với các phần khác nhau của API Quản lý Chrome, cần có các đặc quyền khác nhau của quản trị viên. Xem những đặc quyền cần thiết của quản trị viên đối với
API Báo cáo,
API Thông tin chi tiết về ứng dụng hoặc
API Telemetry.
Cách cấp đặc quyền:
- Là quản trị viên của khách hàng, hãy truy cập vào Bảng điều khiển dành cho quản trị viên (https://admin.google.com/).
- Chuyển đến trang
Admin roles
.
- Tìm vai trò hiện có hoặc tạo vai trò mới với các đặc quyền cần thiết.
- Chỉ định vai trò này cho địa chỉ email của người dùng hoặc địa chỉ email của tài khoản dịch vụ.
Cách kiểm thử ứng dụng trong OAuth Playground
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-25 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[[["\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`"]]