Spring Authorization Server should provide native, configurable support for hashing long-lived credentials (specifically OAuth2RefreshToken)

オープン
#19,698 コメント 4 件 リアクション 4 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
java, spring

調査の方向性

OAuth2RefreshTokenAuthenticationProvider、OAuth2TokenRevocationAuthenticationProvider、OAuth2TokenIntrospectionAuthenticationProviderから始め、それらによるOAuth2AuthorizationServiceの使用方法とトークン比較を追跡します。認可コードとリフレッシュトークンがどのように永続化および検証されるかを確認します。平文で保存することなく、設定可能なハッシュ化と検証で対象の認証情報を扱えることを完了条件とします。

索引モデルが issue の本文から書いたものです。

説明

status: waiting-for-triage type: enhancement

Expected Behavior

Spring Authorization Server should provide native, configurable support for hashing long-lived credentials (specifically OAuth2RefreshToken and authorization codes) at rest using a pluggable mechanism similar to PasswordEncoder. The persistence layer should store cryptographic hashes (e.g., SHA-256), and authentication providers should verify incoming tokens against these hashes without requiring plain-text storage.

Current Behavior

Authentication providers (OAuth2RefreshTokenAuthenticationProvider, OAuth2TokenRevocationAuthenticationProvider, and OAuth2TokenIntrospectionAuthenticationProvider) perform a strict plain-text .equals() comparison between the incoming token and the value retrieved from OAuth2AuthorizationService. As a result, raw tokens must be stored in plaintext within the database.

Context

How this has affected you / What you are trying to accomplish: Trying to harden the authorization server implementation against database leaks. Storing long-lived tokens in plaintext violates standard security hardening guidelines for data at rest. Additionally, indexing large plaintext token strings in relational databases creates performance bottlenecks compared to fixed-length hashes.

What other alternatives have you considered: Relying solely on short token expiration or storing tokens in an external key-value store, which increases architectural complexity.

Are you aware of any workarounds: Yes, developers currently have to implement fragile workarounds such as overriding OAuth2AuthorizationService.findByToken() to dynamically inject raw mock tokens into the domain model, or entirely unregistering and rewriting core AuthenticationProvider implementations.

主要言語
Java
スター
9.7k
フォーク
6.4k
平均マージ
3時間 11分
マージ済み PR(30日)
19

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

spring-projects/spring-security のほかの issue

spring-projects/spring-security の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。