@@ -10,7 +10,47 @@ in a JWT (called *request object*) instead of directly instead of GET or POST pa
1010
1111The request object can either be passed directly in a ``request `` parameter,
1212or be hosted by the client and be passed by reference with a ``request_uri ``
13- parameter.
13+ parameter. By reference, the Authorization Server fetches the request object
14+ itself:
15+
16+ .. mermaid ::
17+
18+ sequenceDiagram
19+ autonumber
20+ participant User as User's browser<br/>(User Agent)
21+ participant Client
22+ box rgba(80, 120, 220, 0.12) JWTAuthenticationRequest
23+ participant AS as Authorization Server
24+ end
25+
26+ Note over Client: Signs a request object
27+ Client-->>User: 302 Found → /authorize
28+ User->>AS: GET /authorize (request or request_uri)
29+ opt By reference
30+ AS->>Client: GET request_uri
31+ Client-->>AS: 200 OK + request object
32+ end
33+ Note over AS: Verifies the request object
34+ Note over User,AS: The user logs in and approves
35+ AS-->>User: 302 Found → redirect_uri?code=…
36+
37+ 1. The client signs a JWT that contains the authorization request
38+ parameters. It redirects the browser to the authorization endpoint.
39+ 2. The request contains ``client_id ``, and either the JWT as ``request ``, or
40+ its URL as ``request_uri ``. :class: `JWTAuthenticationRequest ` rejects the
41+ request if both are present.
42+ 3. With ``request_uri `` only. ``validate_request_uri `` decides whether the
43+ server may fetch this URL for this client. It rejects every URL by
44+ default. ``get_request_object `` then fetches the JWT. See `Retrieving
45+ request objects `_.
46+ 4. The client returns the JWT.
47+ 5. In both cases, :class: `JWTAuthenticationRequest ` checks the JWT
48+ signature with the client key, the signing algorithm, and that the
49+ ``client_id `` claim matches the ``client_id `` parameter. The claims of
50+ the JWT then replace the request parameters, and the authorization flow
51+ goes on as usual.
52+
53+ The ``/authorize `` path is an example.
1454
1555This usage is more secure than passing the request payload directly in the request,
1656read the RFC to know all the details.
0 commit comments