0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

RFC 7009 - OAuth 2.0 Token Revocation メモ

Posted at

Token Revocation

  • トークンが不要になったことを認可サーバーに通知し、認可サーバーはそのトークンに関連付けられたデータ(セッションデータなど)をクリーンアップすること。

    • このような処理により、エンドユーザーが認識していない特定クライアントへの有効な認可が残留する状況を回避できる
  • 失効対象トークン

    • アクセストークン:推奨
    • リフレッシュトークン:必須

Revocation Request

リクエスト例

POST /revoke HTTP/1.1
Host: server.example.com
Content-Type: application/x-www-form-urlencoded
Authorization: Basic czZCaGRSa3F0MzpnWDFmQmF0M2JW

token=45ghiukldjahdnhzdauz&token_type_hint=refresh_token
  • token : 失効対象トークン。必須。
  • token_type_hint : トークン種別。任意。
  • 指定されたトークンがリフレッシュトークンで、認可サーバーがアクセストークンの失効をサポートしている場合、認可サーバーは、紐づけ関係に基づき全アクセストークンを無効にする必要がある。
  • リクエストに渡されたトークンがアクセストークンの場合、認可サーバーはそれぞれのリフレッシュトークンも取り消す場合がある。

Revocation Response

  • 失効に成功した場合、200応答を返却する。
  • エラーコードunsupported_token_type
    • 認可サーバーが、提示されたトークンタイプの取り消しをサポートしていない

セキュリティに関する考慮事項

  • 認可サーバーがアクセストークンの取り消しをサポートしていない場合、対応するリフレッシュトークンが取り消されても、アクセストークンはすぐに無効にはならないことがある。
  • DoS攻撃
    • 無効なトークンを指定された場合にも、データベース参照を行うような場合。
  • トークンの推測
    • 潜在的なトークン文字列に対して失効リクエストを行うことで、当該エンドポイントで有効なトークンを推測されること。
  • トークン・クレデンシャルの詐取
    • 偽造Revocationエンドポイントを利用し、有効なセキュリティトークンを取得されること。

参考情報

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?