Apps Script公式リファレンス: Apps Script Reference |障害・課題追跡: IssueTracker |Google Workspace: Status Dashboard - Summary

2019年3月31日日曜日

Google APIのスコープ一覧を知りたい


Google Apps Scriptのスコープを設定したくて調べた備忘録


一覧はここに書かれていた

OAuth 2.0 Scopes for Google APIs
https://developers.google.com/identity/protocols/googlescopes



Google Apps Scriptのスコープを設定してみる


「スコープ」は書かれたコードから自動判定されるようですが、広すぎるようです


「スコープ」って何?

  • スクリプトの実行に必要なアクセス権
  • スクリプトを実行するユーザのデータに対して、どんな操作を行うか
  • 例えば「データを読むだけ」とか「アプリで作ったデータの読み書きだけ」とか



どこに書かれているか
「ファイル > スクリプトのプロパティ > スコープ」 の中で確認できる


どこで設定できるか
「表示 > マニフェスト ファイルを表示」でappsscript.jsonが開くので

  "oauthScopes": [
    "https://www.googleapis.com/auth/drive.file"
  ],

このように追加してやる




manifest.json
{
  "timeZone": "Asia/Tokyo",
  "dependencies": {
  },
  "oauthScopes": [
    "https://www.googleapis.com/auth/drive.file"
  ],
  "exceptionLogging": "STACKDRIVER"
}


参考

Authorization Scopes (manifest.jsonに書くScope)
https://developers.google.com/apps-script/concepts/scopes


OAuth 2.0 Scopes for Google APIs (Scopeの一覧)
https://developers.google.com/identity/protocols/googlescopes


Authorize Requests (スプレッドシートのスコープ)
https://developers.google.com/sheets/api/guides/authorizing

Latest post

Google Apps Scriptの障害時はIssueTrackerを見てみる - Incidents for Apps Script are reported on Issue Tracker

IssueTracker > Apps Script issues https://issuetracker.google.com/savedsearches/566234 Google Apps Scriptの障害時は IssueTracker に課題が上がっていることが...