ما قویاً توصیه می کنیم که هنگام ادغام با SAS Portal API از یک حساب سرویس برای احراز هویت استفاده کنید. در صورت لزوم، یک حساب خدمات ایجاد کنید . هنگام ایجاد کلید حساب سرویس خود، حتماً JSON را به عنوان نوع کلید خود انتخاب کنید. پس از تکمیل، کلید حساب سرویس شما در مکان پیش فرض مرورگر شما دانلود می شود. علاوه بر این، مطمئن شوید که نقش "مالک پروژه" را به حساب سرویس اختصاص دهید.
در مرحله بعد، باید احراز هویت حساب سرویس خود را به عنوان یک توکن حامل ارائه کنید. اگر مستقیماً با SAS Portal API تماس بگیرید، مثلاً با درخواست HTTP با cURL ، احراز هویت خود را بهعنوان یک توکن حامل در سرصفحه Authorization ارسال میکنید. برای دریافت توکن حامل با حساب سرویس خود، این مراحل را دنبال کنید:
تاریخ آخرین بهروزرسانی 2022-09-26 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2022-09-26 بهوقت ساعت هماهنگ جهانی."],[[["Service 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."],["Authentication to the SAS Portal API is done using a Bearer token obtained through the `gcloud` command-line tool by activating the service account and printing an access token."],["When calling the API, include the Bearer token in the `Authorization` header of your request along with the `X-Goog-User-Project` header specifying your Google Cloud Project ID."]]],["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"]]