Mastodon
  • Mastodonの使い方
    • Signing up for an account
    • Setting up your profile
    • Posting toots
    • Using the network features
    • Dealing with unwanted content
    • Promoting yourself and others
    • Set your preferences
    • その他の設定
    • Using Mastodon externally
    • Moving or leaving accounts
  • Mastodonの構築
    • マシンの準備
    • ソースからインストール
    • 環境設定
    • オプションのインストール
      • 全文検索
      • 秘匿サービス
      • シングルサインオン
    • セットアップを完了する
    • 開発者向けコマンドラインを利用する
    • 新しいバージョンへアップグレード
    • サーバのバックアップ
    • 新しいマシンへの移行
    • サーバーのスケールアップ
    • モデレーション
    • トラブルシューティング
  • アプリケーションの開発
    • Getting started with the API
    • Playing with public data
    • Obtaining client app access
    • ログイン
    • ガイドラインとベストプラクティス
    • ライブラリ等
  • コントリビューション
    • 技術的情報
    • 開発環境のセットアップ
    • ソースコードの構造
    • ルーティング
  • スペック
    • ActivityPub
    • WebFinger
    • Security
    • Microformats
    • OAuth
  • REST API
    • OAuthスコープ
  • API一覧
    • apps
      • oauth
    • accounts
      • bookmarks
      • favourites
      • mutes
      • blocks
      • domain_blocks
      • filters
      • reports
      • follow_requests
      • endorsements
      • featured_tags
      • preferences
      • suggestions
    • statuses
      • media
      • polls
      • scheduled_statuses
      • streaming
    • timelines
      • conversations
      • lists
      • markers
    • notifications
      • push
    • search
    • instance
      • trends
      • directory
      • custom_emojis
    • admin
    • proofs
    • oembed
  • APIエンティティ
    • Account
    • Activity
    • Admin::Account
    • Admin::Report
    • Application
    • Attachment
    • Card
    • Context
    • Conversation
    • Emoji
    • Error
    • FeaturedTag
    • Field
    • Filter
    • History
    • IdentityProof
    • Instance
    • List
    • Marker
    • Mention
    • Notification
    • Poll
    • Preferences
    • PushSubscription
    • Relationship
    • Report
    • Results
    • ScheduledStatus
    • Source
    • Status
    • Tag
    • Token

OAuthスコープ

APIでできることを。権限。

OAuthスコープ

スコープは階層的です。つまり、readにアクセスできる場合、read:accountsは自動的に適用されます。アプリケーションはユーザーに対してできるだけ少ない要求を行うようにすべきです

複数のスコープを同時に要求できます。パラメーターを使用してアプリを作成するときscopes、OAuthで認証するときはscopeクエリパラメーターを使用します(スコープをスペースで区切ります)。

注意 scopeとscopesの違いに気をつけてください。scopeは標準的なOAuthのパラメーター名でOAuthメソッド中はこれを使いますが、MastodonのAPIではより適切なscopesが用いられます。

scopeが認証時に無かったり、scopesがアプリケーション登録時に無い場合はreadとして扱われます。

アプリの作成中に保存されるスコープのセットには、認証リクエストでリクエストするすべてのスコープが含まれている必要があります。そうでない場合、認証は失敗します。

実装履歴

  • 0.9.0 - read, write, follow
  • 2.4.0 - push
  • 2.4.3 - 詳細なスコープ(:以下のスコープ) https://github.com/tootsuite/mastodon/pull/7929
  • 2.6.0 - read:reportsを削除 (unused stub) https://github.com/tootsuite/mastodon/pull/8736/commits/adcf23f1d00c8ff6877ca2ee2af258f326ae4e1f
  • 2.6.0 - write:conversationsスコープを追加 https://github.com/tootsuite/mastodon/pull/9009
  • 2.9.1 - Admin関連スコープを追加 https://github.com/tootsuite/mastodon/pull/9387
  • 3.1.0 - Bookmark関連スコープを追加

スコープ一覧

read

データの読み取りを許可します。readはread:*を意味します。read:~と書いてあるものが全て許可されます。

write

データの変更を許可します。writeはwrite:*を意味します。write:~と書いてあるものが全て許可されます。

follow

フォロー関係を読み取り、変更できます。followはfollow:*を意味します。follow:~と書いてあるものが全て許可されます。

  • read:blocks, write:blocks
  • read:follows, write:follows
  • read:mutes, write:mutes

push

Web Push APIの購読を許可します。Mastodon 2.4.0で追加されました。

Admin関連スコープ

モデレーションAPIのために使用されます。Mastodon 2.9.1で追加されました。以下の:1階層スコープを許容します。つまりadminというスコープはなく、admin:readとadmin:writeが独立して存在します。

  • admin:read
    • admin:read:accounts
    • admin:read:reports
  • admin:write
    • admin:write:accounts
    • admin:write:reports

詳細なスコープ

read write
read:accounts write:accounts
read:blocks write:blocks
read:bookmarks write:bookmarks
write:conversations
read:favourites write:favourites
read:filters write:filters
read:follows write:follows
read:lists write:lists
write:media
read:mutes write:mutes
read:notifications write:notifications
write:reports
read:search
read:statuses write:statuses
admin:read admin:write
admin:read:accounts admin:write:accounts
admin:read:reports admin:write:reports

最終更新 March 4, 2020 · このページを改善する
他の言語: English

Merch

Tシャツとステッカー(英語)

Mastodonに参加しよう · ブログ · ·

ソースコード · CC BY-SA 4.0 · インプリント