अनुमति देना और पुष्टि करना
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
हमारा सुझाव है कि SAS Portal API के साथ इंटिग्रेट करते समय, पुष्टि करने के लिए सेवा खाते का इस्तेमाल करें. अगर ज़रूरी हो, तो
सेवा खाता बनाएं.
अपनी सेवा खाते की कुंजी बनाते समय, पक्का करें कि आपने कुंजी के टाइप के तौर पर JSON को चुना हो. यह प्रोसेस पूरी होने के बाद, आपकी सेवा खाते की कुंजी आपके ब्राउज़र की डिफ़ॉल्ट जगह पर डाउनलोड हो जाती है. इसके अलावा, पक्का करें कि आपने सेवा खाते को
"प्रोजेक्ट के मालिक" की भूमिका असाइन की हो.
इसके बाद, आपको अपने सेवा खाते की पुष्टि, बियरर टोकन के तौर पर करनी होगी. अगर SAS Portal API को सीधे तौर पर कॉल किया जाता है, जैसे कि cURL
के साथ एचटीटीपी अनुरोध करके, तो आपको Authorization
हेडर में Bearer टोकन के तौर पर पुष्टि करनी होगी. अपने सेवा खाते से Bearer टोकन पाने के लिए, यह तरीका अपनाएं:
-
gcloud
कमांड-लाइन टूल इंस्टॉल करें.
-
अपने सेवा खाते में पुष्टि करें. नीचे दिए गए निर्देश में, ${KEY_FILE} की जगह पर सेवा खाते की कुंजी वाली फ़ाइल का पाथ डालें:
gcloud auth activate-service-account --key-file ${KEY_FILE}
-
अनुमति देने वाला टोकन पाने के लिए, अपने सेवा खाते का इस्तेमाल करें:
gcloud auth print-access-token
इस कमांड से, ऐक्सेस टोकन की वैल्यू मिलती है.
-
एपीआई का इस्तेमाल करते समय, टोकन की वैल्यू को Authorization
हेडर में Bearer टोकन के तौर पर पास करें. नीचे दिया गया उदाहरण देखें:
curl -X GET -H "X-Goog-User-Project: ${CLIENT_PROJECT}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${TOKEN}" \
"https://sasportal.googleapis.com/v1alpha1/customers"
${CLIENT_PROJECT} को उस
Google Cloud प्रोजेक्ट के आईडी पर सेट करें जिससे अनुरोध किए जाते हैं. इसके बाद, ${TOKEN} को ऑथराइज़ेशन टोकन पर सेट करें.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-25 (UTC) को अपडेट किया गया.
[[["समझने में आसान है","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-25 (UTC) को अपडेट किया गया."],[[["\u003cp\u003eService accounts are the recommended authentication method for integrating with the SAS Portal API, requiring the creation of a service account with a JSON key and granting it the "Project Owner" role.\u003c/p\u003e\n"],["\u003cp\u003eAuthentication to the SAS Portal API is done using a Bearer token obtained through the \u003ccode\u003egcloud\u003c/code\u003e command-line tool by activating the service account and printing an access token.\u003c/p\u003e\n"],["\u003cp\u003eWhen calling the API, include the Bearer token in the \u003ccode\u003eAuthorization\u003c/code\u003e header of your request along with the \u003ccode\u003eX-Goog-User-Project\u003c/code\u003e header specifying your Google Cloud Project ID.\u003c/p\u003e\n"]]],["The key actions are creating a service account with a JSON key, granting it the \"Project Owner\" role, and obtaining a Bearer token for API authentication. This is done by installing the `gcloud` tool, authenticating the service account using `gcloud auth activate-service-account --key-file`, and generating an access token via `gcloud auth print-access-token`. This token should then be included in the `Authorization` header when making API calls as a Bearer token.\n"],null,[]]