Kể từ ngày 13 tháng 6 năm 2023, Hành động trò chuyện không còn được dùng nữa. Để biết thêm thông tin, hãy xem phần Hành động trò chuyện ngừng hoạt động.
Các phương pháp hay nhất về quyền riêng tư và bảo mật
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.
Dưới đây là một số nguyên tắc về bảo mật và quyền riêng tư dành cho nhà phát triển sử dụng API Trợ lý Google trong dự án.
Uỷ quyền API và ứng dụng
Mọi ứng dụng sử dụng API Trợ lý Google đều phải có thông tin xác thực uỷ quyền xác định ứng dụng gửi đến máy chủ xác thực của Google.
Thường thì các thông tin xác thực này được lưu trữ trong tệp client_secret_<client-id>.json đã tải xuống. Hãy nhớ lưu trữ tệp này ở vị trí mà chỉ ứng dụng của bạn mới có thể truy cập.
Ứng dụng của bạn có thể nhắc người dùng cấp quyền truy cập vào Tài khoản Google của họ.
Nếu bạn cho phép, ứng dụng của bạn có thể yêu cầu mã truy cập cho người dùng đó. Những mã thông báo này sẽ hết hạn nhưng bạn có thể làm mới.
Mã thông báo làm mới không được bảo vệ trên thiết bị gây ra rủi ro bảo mật đáng kể. Hãy đảm bảo rằng ứng dụng của bạn:
Lưu trữ mã làm mới ở một nơi an toàn.
Cung cấp một cách dễ dàng để xoá mã thông báo khỏi thiết bị. Ví dụ: cung cấp nút "Đăng xuất" để xoá mã thông báo (nếu ứng dụng có giao diện người dùng) hoặc tập lệnh dòng lệnh mà người dùng có thể thực thi.
Thông báo cho người dùng biết rằng họ có thể huỷ cấp quyền truy cập vào Tài khoản Google của mình. Thao tác này sẽ thu hồi mã làm mới; để sử dụng lại ứng dụng, người dùng cần cấp lại quyền truy cập.
Khi sử dụng xong thiết bị vĩnh viễn, bạn nên xoá tất cả các mã thông báo khỏi thiết bị đó.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[[["\u003cp\u003eThe Google Assistant Library for Python is deprecated; developers should utilize the Google Assistant Service instead.\u003c/p\u003e\n"],["\u003cp\u003eApplications using the Google Assistant API require authorization credentials for secure identification, and developers must store these credentials securely.\u003c/p\u003e\n"],["\u003cp\u003eApplications should provide a mechanism for users to easily clear stored refresh tokens to enhance security and user privacy.\u003c/p\u003e\n"],["\u003cp\u003eUsers can deauthorize application access to their Google account, revoking refresh tokens and requiring re-authorization for future use.\u003c/p\u003e\n"]]],["The Google Assistant Library for Python is deprecated; use the Google Assistant Service instead. Applications using the Google Assistant API need authorization credentials, typically in a `client_secret_.json` file, which must be stored securely. User-granted access tokens expire but can be refreshed. Refresh tokens should be stored securely, with an easy way for users to clear them, such as a \"Sign out\" button or script, and users can deauthorize access via their Google account settings. Devices should be cleared of all tokens when no longer in use.\n"],null,["# Best Practices for Privacy and Security\n\n| **Warning:** The Google Assistant Library for Python is deprecated as of June 28th, 2019. Use the [Google Assistant Service](/assistant/sdk/guides/service/python) instead.\n\n\u003cbr /\u003e\n\nHere are some security and privacy guidelines for developers using the Google\nAssistant API in their projects.\n\nAPI and application authorization\n---------------------------------\n\nAny application that uses the Google Assistant API must have authorization\ncredentials that identify the application to Google's authentication server.\nTypically, these credentials are stored in a downloaded `client_secret_\u003cclient-id\u003e.json`\nfile. Make sure to store this file in a location that only your application\ncan access.\n\nYour application may prompt the user to grant it access to their Google account.\nIf granted, your application can request an access token for that user. These\ntokens expire, but can be refreshed.\n\nUnprotected refresh tokens on a device pose a significant security risk. Make\nsure your application:\n\n- Stores the refresh tokens in a secure place.\n- Provides an easy way to clear tokens from the device. For example, provide a \"Sign out\" button that clears a token (if the application has a UI) or a command line script that the user can execute.\n- Informs users that they can [deauthorize access](https://myaccount.google.com/permissions) to their Google account. This revokes the refresh token; to use the application again, the user would need to re-authorize access.\n\nWhen you are done using the device permanently, you should clear all of the\ntokens from it.\n\nFor more information, see [Using OAuth 2.0 to Access Google APIs](https://developers.google.com/identity/protocols/OAuth2)."]]