對話動作已於 2023 年 6 月 13 日淘汰。詳情請參閱「
對話動作已淘汰」。
Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
隱私權與安全性的最佳做法
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
以下是開發人員在專案中使用 Google Assistant API 時應遵守的安全性和隱私權規範。
API 和應用程式授權
凡是使用 Google 助理 API 的應用程式,都必須具備可讓 Google 的驗證伺服器識別該應用程式的授權憑證。一般來說,這些憑證會儲存在下載的 client_secret_<client-id>.json 檔案中。請務必將這個檔案儲存在只有應用程式可存取的位置。
您的應用程式可能會提示使用者授予 Google 帳戶存取權。如果授予權限,應用程式就能為該使用者要求存取權杖。這些權杖會過期,但可以重新整理。
裝置上未受保護的更新權杖會帶來重大的安全性風險。請確保應用程式符合以下條件:
- 將更新權杖儲存在安全的地方。
- 可讓您輕鬆從裝置中清除權杖。例如,提供可清除權杖 (如果應用程式有 UI 的話) 或指令列指令碼的「登出」按鈕,讓使用者可以執行的指令列指令碼。
- 告知使用者,他們可以取消授予 Google 帳戶的存取權。這麼做會撤銷更新權杖;如要再次使用應用程式,使用者必須重新授權存取權。
永久使用裝置後,建議您清除裝置上的所有權杖。
如要瞭解詳情,請參閱使用 OAuth 2.0 存取 Google API。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-26 (世界標準時間)。"],[],["Applications using the Google Assistant API require authorization credentials, typically stored in a `client_secret` file, which should be securely stored. Applications may obtain user-specific access tokens, which can be refreshed. Refresh tokens must be securely stored, and applications should allow users to clear them, such as through a \"Sign out\" feature or a command line. Users should be informed that they can deauthorize application access, and all tokens should be cleared when a device is no longer used.\n"]]