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?

PKCEによるOAuth 2.0のセキュリティ強化

Posted at

PKCEの概要

PKCEは、OAuth 2.0の拡張仕様として開発された認証セキュリティ強化メカニズムである。

  • PKCE: Proof Key for Code Exchange(ピクシーと発音)
  • RFC 7636で定義
  • 主に認可コード横取り攻撃への対策が目的

PKCEの仕組み

  1. クライアントが「code_verifier」というランダムな文字列を生成
  2. 「code_verifier」をハッシュ化した「code_challenge」を認可リクエスト時に送信
  3. アクセストークン取得時に元の「code_verifier」を送信
  4. 認可サーバーが「code_verifier」を検証し、正当なクライアントであることを確認

PKCEの利点

  • パブリッククライアント(モバイルアプリやSPA)のセキュリティ向上
  • 認可コードの横取りリスクを軽減
  • CSRF(クロスサイトリクエストフォージェリ)対策としても有効

現在の推奨事項

  • 認可コードフローを使用するすべてのクライアントタイプ(ウェブアプリケーションを含む)でPKCEの使用を推奨
  • 新規クライアント作成時にPKCEを必須とする設定が一般的

PKCEは、OAuth 2.0のセキュリティを大幅に向上させる重要な拡張機能として、現代のアプリケーション開発において広く採用されている。

参考文献

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?