08-rich-authorization-requests

command
v0.3.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

08: Rich Authorization Requests

Non-UI · No infrastructure needed · RFC 9396

Fine-grained, structured authorization_details on the token endpoint — what banks, fintechs, and any regulated industry need beyond flat scopes. The Payments API and Accounts API enforce different RAR types, proving a payment token can't read accounts.

Three-server architecture

main.go boots three real servers:

  • Auth Server — token endpoint, introspection, AS metadata advertising authorization_details_types_supported
  • Payments API — RequireAuthorizationDetails("payment_initiation") middleware
  • Accounts API — RequireAuthorizationDetails("account_information") middleware

With --serve, all three bind on real ports (:8081/:8082/:8083).

Quick start

make demo                              # interactive walkthrough
make serve                             # AS :8081, payments :8082, accounts :8083

Optional: cross-server with the RAR test issuer

cd ../.. && make uprar                 # cmd/rar-test-issuer on :8181
cd examples/08-rich-authorization-requests && make demo

See WALKTHROUGH.md for the full step-by-step.

Targets

make … What
demo (default) Walkthrough with TUI renderer
demo-plain Plain renderer
demo-ci Non-interactive
serve Bind AS + Payments + Accounts on real ports
walkthrough Regenerate WALKTHROUGH.md

What's next

09 — Key Rotation — rotate signing keys with a grace period.

Documentation

Overview

Example 08: Rich Authorization Requests (RFC 9396).

Flat scopes can't express "transfer 45 EUR to Merchant A". RAR adds structured `authorization_details` to the token endpoint, JWT claim, introspection response, and middleware enforcement.

Three-server architecture:

make serve    # auth :8081, payments :8082, accounts :8083
make demo     # walkthrough that drives all three

See: https://www.rfc-editor.org/rfc/rfc9396

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL