Revoke full token chain on OIDC authorization-code replay
The replay handler previously used a created_at time-range filter to target access tokens and called update_all(expires_at:), which left revoked_at nil, skipped refresh tokens entirely, and could miss or falsely catch tokens from concurrent flows. Add an oidc_authorization_code FK on both token tables, carry it through refresh-token rotation, and use the association to revoke every descendant via revoke! (which sets revoked_at and cascades access -> refresh). Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
class AddOidcAuthorizationCodeIdToTokens < ActiveRecord::Migration[8.1]
|
||||
def change
|
||||
add_reference :oidc_access_tokens, :oidc_authorization_code,
|
||||
null: true, foreign_key: true, index: true
|
||||
add_reference :oidc_refresh_tokens, :oidc_authorization_code,
|
||||
null: true, foreign_key: true, index: true
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user