Skip to content

Add Rich Authorization Requests support - #133

Draft
thiva-k wants to merge 1 commit into
thunder-id:mainfrom
thiva-k:feat/authorization-details
Draft

thiva-k wants to merge 1 commit into
thunder-id:mainfrom
thiva-k:feat/authorization-details

Conversation

@thiva-k

@thiva-k thiva-k commented Oct 23, 2026 •

Copy link
Copy Markdown

Purpose

Adds Rich Authorization Requests (RFC 9396) support to the JavaScript SDKs: clients can request authorization_details and read what was granted, and the React consent UI renders authorization details with the changes a user may make to them.

Approach

  • Request and token (@thunderid/javascript, browser, node, express):
    • New authorizationDetails config key and per-call sign-in option, sent JSON-encoded as authorization_details on the authorization request and on the client_credentials token request.
    • Object values in authorize parameters are JSON-encoded.
    • Granted details are surfaced as TokenResponse.authorizationDetails and in session data (node signIn, express onSignIn). Browser apps read the access token's authorization_details claim.
  • Consent (@thunderid/javascript, react):
    • Consent models for the authorization details purpose (one element per detail, with its summary and rows).
    • Shared helpers in the core package, used by React, Vue and Nuxt: per-element decisions with the user's changes (getConsentElementDecision, getConsentModifiedValues) and form keys scoped by purpose. Field input parsing, validation and list toggling stay private to the React hook, and the display helpers live in React utils.
    • Following the existing Consent / ConsentCheckboxList split, React gets headless pieces (ConsentAuthorizationDetail, useConsentDetailField, isConsentApprovalBlocked and isApprovalBlocked on Consent) and a default UI built on them. A field keeps what the user types, writes a value only when it is valid and within its bound, and shows an inline error otherwise; approval is blocked while a field is invalid, and denial always works.
    • SignIn, BaseAcceptInvite and AuthOptionFactory keep their existing decision building; detail elements additionally carry the user's changes (modified), and the new form keys are removed before submission. Attribute and permission decisions are unchanged.
    • Translations for all locales.
  • Vue and Nuxt: they don't render consent today. Their existing decision building also handles detail elements, so a detail is never approved unless the application sets it, and Vue forwards authorizationDetails on sign-in.
  • Scope: consent for authorization details is rendered by the authorization server's own UI (hosted login). App-native flows cannot carry authorization details.

Related Issues

Related PRs

SDK parity

Checklist

  • Followed the contribution guidelines.
  • Manual test round performed and verified.
  • Documentation provided. (Add links if there are any)
  • Tests provided. (Add links if there are any)
    • Unit Tests
    • Integration Tests
  • Breaking changes. (Fill if applicable)
    • Breaking changes section filled.
    • breaking change label added.
  • Cross-SDK parity. Exactly one of parity/prs-raised or parity/prs-not-needed added.
    • If parity/prs-raised, the port links are posted as a reply on the parity check's comment.

Security checks

  • Followed secure coding standards.
  • Confirmed that this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.

@thiva-k thiva-k added the parity/prs-raised Ports exist in the other SDKs, or are recorded as not applying there label Oct 23, 2026
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

🔀 Cross-SDK feature parity, ports raised

This pull request is labelled parity/prs-raised, so the capability it introduces is expected in the other ThunderID SDKs as well.

Ports (DO NOT EDIT)

  • thunder-id/ios-sdks, iOS => does not apply
  • thunder-id/android-sdks, Android => does not apply
  • thunder-id/flutter-sdks, Flutter => does not apply

3 of 3 sibling SDKs accounted for.

Every sibling SDK is accounted for.

The contract is in the SDK development specification.

@coderabbitai

coderabbitai Bot commented Oct 23, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@thiva-k

thiva-k commented Oct 23, 2026

Copy link
Copy Markdown
Author

Ports for the request-side capability (sending authorization_details and surfacing the granted details) are deferred and tracked in thunder-id/thunderid#6012. Consent rendering of authorization details does not apply to these SDKs, since none of them renders consent prompts.

@thiva-k thiva-k changed the title Add Rich Authorization Requests (RFC 9396) support Add Rich Authorization Requests support Oct 23, 2026
@thiva-k
thiva-k force-pushed the feat/authorization-details branch from c1dd33a to 958bc2f Compare October 24, 2026 08:49
@thiva-k
thiva-k force-pushed the feat/authorization-details branch from 958bc2f to 93d3d28 Compare October 24, 2026 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

parity/prs-raised Ports exist in the other SDKs, or are recorded as not applying there

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant