Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
承認と認証
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
SAS Portal API と統合する場合は、認証にサービス アカウントを使用することを強くおすすめします。必要に応じて、
サービス アカウントを作成します。
サービス アカウント キーを作成する際は、キーのタイプとして JSON を選択してください。完了すると、ブラウザのデフォルトの場所にサービス アカウント キーがダウンロードされます。また、サービス アカウントに
「プロジェクト オーナー」のロールを付与してください。
次に、サービス アカウントの認証を Bearer トークンとして指定する必要があります。cURL で HTTP リクエストを行うなど、SAS Portal API を直接呼び出す場合は、Authorization ヘッダーで Bearer トークンとして認証を渡します。サービス アカウントを使用して署名なしトークンを取得する手順は次のとおりです。
-
gcloud コマンドライン ツールをインストールします。
-
サービス アカウントを認証します。次のコマンドで、${KEY_FILE} をサービス アカウント キーファイルのパスに置き換えます。
gcloud auth activate-service-account --key-file ${KEY_FILE}
-
サービス アカウントを使用して認可トークンを取得します。
gcloud auth print-access-token
このコマンドはアクセス トークンの値を返します。
-
API を使用する場合は、トークン値を 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 プロジェクトの ID に設定し、${TOKEN} を認証トークンに設定します。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2026-02-18 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"]],["最終更新日 2026-02-18 UTC。"],[],["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"]]