Skip to content

Add Rich Authorization Requests (RAR) support - #133

Merged
thiva-k merged 1 commit into
thunder-id:mainfrom
thiva-k:feat/authorization-details
Oct 28, 2026
Merged

thiva-k merged 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
Contributor

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.

runtime-consent-1.5x.mp4

Approach

  • Request and token (@thunderid/javascript, browser, node, express):
    • New authorizationDetails config key and per-call option, sent JSON-encoded as authorization_details on the authorization request, the CIBA backchannel request (initiateCIBA) and 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. An approval is not submitted while a detail field is invalid. 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, Vue forwards authorizationDetails on sign-in, and Nuxt passes the configured value to the server client.
  • Scope: consent for authorization details is rendered by the authorization server's own UI (hosted login). App-native flows cannot carry authorization details.

Demo

Sign-in from a sample app, the processor adjusting the request, and the consent screen rendered with the new headless pieces: a value outside its policy blocks approval, the user narrows the amount and removes an action, and the token carries only what was approved.

[Video placeholder: drag runtime-consent.mp4 here]

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

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • 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
Contributor 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 4 times, most recently from 6cbc020 to d623198 Compare October 26, 2026 13:19
@thiva-k
thiva-k marked this pull request as ready for review October 26, 2026 18:01
Refs thunder-id/thunderid#5155

Signed-off-by: thiva-k <kalyanasundaramthivaharan@gmail.com>
@thiva-k
thiva-k force-pushed the feat/authorization-details branch from d623198 to 5b5054b Compare October 27, 2026 15:52
@brionmario brionmario changed the title Add Rich Authorization Requests support Add Rich Authorization Requests (RAR) support Oct 28, 2026
@brionmario brionmario added the parity/prs-pending Porting in the other SDKs are still pending and issues are created label Oct 28, 2026
@thiva-k
thiva-k merged commit e5918c5 into thunder-id:main Oct 28, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

parity/prs-pending Porting in the other SDKs are still pending and issues are created 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.

2 participants