← Back to Pull requests

Retry DPoP token requests once on use_dpop_nonce #57

Closed
unknown closed this pull request without merging on Nov 16, 2026 16:06 UTC
View on GitHub
unknown unknown commented on Nov 14, 2026 15:48 UTC
Author

Retries a DPoP token endpoint request once when the authorization server answers use_dpop_nonce (RFC 9449 §8). The retry uses the same DPoP handle, which stores the nonce from the first response. Without it, login and refresh fail against authorization servers that require DPoP nonces.

Closes only the nonce half of #28 (Jesse's comment there lists this requirement). The consent / offline_access part stays open. It was first proposed in #12.

h/t @jeswr: the helper follows withDPoPNonceRetry in jeswr/solid-sdk.

Changes


  • withDPoPNonceRetry helper in src/dpopNonce.ts. It retries once on oauth.isDPoPNonceError. A second nonce error or any other error propagates.

  • Applied to the authorization code grant, the refresh grant and the client credentials grant. Each wraps the request together with its oauth.process*Response call, because oauth4webapi throws the nonce error from the process step and stores the nonce there.

  • The refresh grant retry stays inside the existing try, so a nonce error does not evict the cache entry.
  • Safety


    The server refuses the nonce before it uses the grant. A refresh grant retry therefore does not reuse a rotated refresh token. The authorization code retry assumes the same, as RFC 9449 §8 implies. I did not test this against a real server.

    Out of scope


  • Retry at the resource server (needs challenge parsing, #55).

  • Consent / offline_access from #28.

  • DPoP algorithm selection.
  • Notes


  • No tests: the repo has no test runner yet.

  • Possible conflicts with #50 and #56, which also touch DPoPTokenProvider. This PR does not wait for them.
  • Diff: 230 lines (+172 / -58) across 2 files Reviewer: jeswr Review duration: 2897m
    All Vouch review confidence checks passed
    Residual risk 0.25 = Change Risk (0.60) × (1 − Review Confidence (0.58)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.60 · 230 lines diff across 2 files
    0.60
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    57%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.326
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.060
    Real PR Conversation Timeline
    1 comments
    "Review active on #57"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 58.0% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 60.2% (MEDIUM) · Higher = larger blast radius
    60.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 58.0% · Lower = rushed or shallow review
    58.0%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 25.3% · Safe to merge
    25.3%