निजता और सुरक्षा के लिए सबसे सही तरीके
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
जो डेवलपर अपने प्रोजेक्ट में Google Assistant API का इस्तेमाल करते हैं, उनके लिए यहां सुरक्षा और निजता से जुड़े कुछ दिशा-निर्देश दिए गए हैं.
एपीआई और ऐप्लिकेशन की अनुमति देना
Google Assistant API का इस्तेमाल करने वाले किसी भी ऐप्लिकेशन के पास ऐसे अनुमति वाले क्रेडेंशियल होने चाहिए जो उस ऐप्लिकेशन की पहचान Google के ऑथेंटिकेशन सर्वर पर करें.
आम तौर पर, ये क्रेडेंशियल डाउनलोड की गई client_secret_<client-id>.json
फ़ाइल में सेव होते हैं. इस फ़ाइल को ऐसी जगह पर रखें जहां सिर्फ़ आपका ऐप्लिकेशन ऐक्सेस कर सके.
आपका ऐप्लिकेशन, उपयोगकर्ता से उसे उनके Google खाते का ऐक्सेस देने के लिए कह सकता है.
अनुमति मिलने पर, आपका ऐप्लिकेशन उस उपयोगकर्ता के लिए ऐक्सेस टोकन का अनुरोध कर सकता है. ये
टोकन खत्म हो जाते हैं, लेकिन इन्हें रीफ़्रेश किया जा सकता है.
डिवाइस पर असुरक्षित रीफ़्रेश टोकन का इस्तेमाल करने से सुरक्षा का बड़ा खतरा हो सकता है. पक्का करें कि आपका आवेदन:
- रीफ़्रेश टोकन को किसी सुरक्षित जगह पर सेव करता है.
- यह डिवाइस से टोकन हटाने का आसान तरीका देता है. उदाहरण के लिए, ऐसा "साइन आउट करें" बटन उपलब्ध कराएं जो किसी टोकन (अगर ऐप्लिकेशन में यूज़र इंटरफ़ेस (यूआई) है) या ऐसी कमांड लाइन स्क्रिप्ट को साफ़ करता हो जिसे उपयोगकर्ता एक्ज़ीक्यूट कर सकता है.
- उपयोगकर्ताओं को सूचना दी जाती है कि वे अपने Google खाते को, ऐक्सेस देने की अनुमति हटा सकते हैं. इससे रीफ़्रेश टोकन रद्द हो जाएगा; ऐप्लिकेशन का फिर से इस्तेमाल
करने के लिए, उपयोगकर्ता को ऐक्सेस को फिर से अनुमति देनी होगी.
डिवाइस का हमेशा के लिए इस्तेमाल करने के बाद, आपको उससे सभी टोकन हटाने चाहिए.
ज़्यादा जानकारी के लिए, Google API को ऐक्सेस करने के लिए OAuth 2.0 का इस्तेमाल करना लेख पढ़ें.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया."],[[["\u003cp\u003eApplications using the Google Assistant API require authorization credentials, typically stored in a \u003ccode\u003eclient_secret_<client-id>.json\u003c/code\u003e file, which should be kept secure.\u003c/p\u003e\n"],["\u003cp\u003eUser granted access allows applications to request access tokens that expire but can be refreshed; however, unprotected refresh tokens pose a security risk and should be stored securely with options for users to clear them.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers should inform users about the ability to deauthorize access to their Google account through Google's permissions page, which revokes the refresh token and requires re-authorization for further application use.\u003c/p\u003e\n"]]],["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"],null,["# Best Practices for Privacy and Security\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)."]]