Beta

Create a tenant

A new tenant starts with its own users, OAuth settings, audit history and logs. You are its first Tenant Admin.

Protecting an authorization response

With PAR and JAR, the printer's request reaches the photo service intact and from a client the service can identify, but the answer still comes back the old way, as plain parameters in a redirect through Ava's browser. JARM has the photo service sign that answer too, so the printer can verify who wrote it and for whom before it uses the code.

An answer anyone can write

The photo service redirects Ava's browser to the printer's callback with a code, state and iss in the query string, and the printer reads them from the address her browser requests. That callback is an ordinary web address. A request can reach it from the photo service's genuine redirect, from a link someone sent Ava, or from a browser extension that rewrote the address on the way. The parameters are plain text. Nothing in them shows that the photo service produced them, or that they arrived unchanged.

The printer is not defenseless. The authorization code flow lessons gave it three checks, which Correlating requests and responses set side by side: state ties the response to a pending attempt in Ava's session, PKCE ties the code to a verifier only the printer holds, and iss names the server that is supposed to have answered. Each answers one question well. None of them shows that the response as a whole came, unaltered, from the photo service and was meant for the printer. Even iss is just text that the response claims about itself.

For many deployments those checks are enough. A deployment that wants the response itself to be verifiable, the way a signed request object is, needs the authorization server to sign it.

Signing the response

The JWT Secured Authorization Response Mode for OAuth 2.0, known as JARM, is an OpenID Foundation specification that does exactly that. Instead of placing each response parameter in the redirect separately, the authorization server puts all of them into a JWT, signs it with its own private key, and sends the JWT as a single parameter called response.

The name comes from response modes. A response mode decides how an authorization server encodes the response it sends back through the browser. The default for the code flow puts the parameters in the query string, and other modes use the URL fragment or a form post. JARM adds a JWT version of each, and a client asks for one in its authorization request.

Asking for a signed response

All domains, codes, and keys in these examples are fictional. Before it relies on signed responses, the printer confirms in the photo service's metadata that the service supports them, and agrees on an algorithm:

Photo service metadata (excerpt):
{
  "issuer": "https://auth.photos.example",
  "response_modes_supported": ["query", "fragment", "form_post",
    "query.jwt", "fragment.jwt", "form_post.jwt", "jwt"],
  "authorization_signing_alg_values_supported": ["ES256"]
}

Printer registration (excerpt):
{
  "client_id": "photo-printer",
  "authorization_signed_response_alg": "ES256"
}

The registration value matters more than it looks. When a client does not specify an algorithm for signed responses, JARM's default is RS256, an RSA algorithm. A service whose signing key is an elliptic curve key, as the photo service's is, and a client that never set the value can fail to agree on a signature for reasons that have nothing to do with security.

The printer then adds one parameter to its authorization request:

https://auth.photos.example/authorize
  ?response_type=code
  &client_id=photo-printer
  &redirect_uri=https%3A%2F%2Fprinter.example%2Foauth%2Fcallback
  &scope=photos.read
  &state=demo-attempt-7
  &code_challenge=qd-75t-gnweZAhIl6REjxxgFnPXGwvqYcxq3vlsaJYQ
  &code_challenge_method=S256
  &response_mode=jwt

response_mode=jwt asks for a signed response in the default encoding for this response type. The parameter is part of the request like any other, so a printer that pushes its requests or signs them puts it in the pushed request or the request object instead of the URL. Nothing changes for Ava: she selects Connect, signs in and approves, as before.

Reading the response

After Ava approves, the photo service redirects her browser to the callback:

HTTP/1.1 302 Found
Location: https://printer.example/oauth/callback?response=eyJhbGciOiJFUzI1NiIsImtpZCI6InBob3Rvcy0yMDI2LTA5In0.eyJpc3MiOiJodHRwczovL2F1dGgucGhvdG9zLmV4YW1wbGUiLCJhdWQiOiJwaG90by1wcmludGVyIiwiZXhwIjoxNzkwODQ1NTAwLCJjb2RlIjoiZGVtby1jb2RlLTciLCJzdGF0ZSI6ImRlbW8tYXR0ZW1wdC03In0...

The signature is shortened here for display. There is no code, state, or iss parameter beside it. The query string holds a single parameter, response, and everything else is inside. Decoded, the JWT reads:

Header:
{
  "alg": "ES256",
  "kid": "photos-2026-09"
}

Claims:
{
  "iss": "https://auth.photos.example",
  "aud": "photo-printer",
  "exp": 1790845500,
  "code": "demo-code-7",
  "state": "demo-attempt-7"
}

The header names the algorithm and the key, one of the signing keys in the photo service's published key set at https://auth.photos.example/jwks. The first three claims protect the response, and every JARM response carries them. iss names the authorization server that created it, the same value the plain iss parameter has carried since Redirects and authorization codes. aud names the client it is meant for, by client ID. Compare that with the request object in Building a request object, whose aud named the authorization server: each signed message is addressed to the party that should accept it. exp limits how long the response is valid. Here it is 2026-10-01 09:05 UTC, five minutes after the response was issued at 09:00, and the specification recommends no more than ten minutes.

Then come the ordinary response parameters, code and state, with the same values as before. A response for another response type would carry that type's parameters in the same way, and a server may add further claims, which the client ignores if it does not recognize them.

Once the printer has verified the signature with the photo service's key, it has four assurances. The parameters are exactly as the photo service wrote them, because any change breaks the signature. The photo service produced them, because only it holds the signing key. They were addressed to the printer, so a response issued to another client is refused. And the server that answered is named inside the signature, which protects against the mix-up attacks that the iss parameter also addresses.

Decoding is not validating, though. Anyone can read these claims, and anyone could write a JWT that contains them. The printer uses none of them until the checks in Response validation and failures have passed.

Choosing a response mode

JARM defines four response modes:

The four JARM response modes and where each carries the JWT
Response modeWhere the JWT travels
query.jwtIn the response parameter of the callback's query string.
fragment.jwtIn the URL fragment, after #. Browsers do not send the fragment to the server, so script on the callback page has to read it.
form_post.jwtIn the body of a form that the browser posts to the callback.
jwtThe default encoding for the response type: query.jwt for the code flow, and fragment.jwt for response types that return tokens from the authorization endpoint.

The printer's jwt therefore meant query.jwt. The query string is acceptable for a response that carries a code, which is single-use and protected by PKCE. It is not acceptable for responses that carry tokens: the specification forbids query.jwt for response types that return access tokens or ID tokens from the authorization endpoint, unless the JWT is encrypted.

With form_post.jwt, the photo service answers Ava's browser with a small page that submits itself:

HTTP/1.1 200 OK
Content-Type: text/html;charset=UTF-8
Cache-Control: no-cache, no-store

<html>
  <body onload="document.forms[0].submit()">
    <form method="post" action="https://printer.example/oauth/callback">
      <input type="hidden" name="response" value="eyJhbGciOiJFUzI1NiIsImtpZCI6InBob3Rvcy0yMDI2LTA5In0...">
    </form>
  </body>
</html>

The JWT then reaches the printer in a POST body, so it stays out of the address bar, browser history, and the Referer header. One side effect catches teams out when they switch. As Request correlation and CSRF noted, a form posted from another site does not carry SameSite=Lax cookies, so the cookie that identifies Ava's pending attempt must be set up for that case, or the printer will find it missing at its callback.

Whichever mode carries it, the JWT is the same, and so are the checks the printer applies before it touches the code.

Encrypting the response

A signed response is still readable. Anyone who sees the redirect, or finds it later in history or a log, can decode the JWT and read the code inside it. JARM therefore allows the server to encrypt the signed JWT as well, using a public encryption key the client has registered, so that only the client can open it. As with request objects, the order is sign first, then encrypt.

Encryption hides what the response says, not the response itself. An encrypted response that leaks can still be copied and delivered again as a whole, so it does not remove the need for PKCE. Many deployments that sign their responses do not encrypt them, because a response that carries only a code holds nothing confidential that PKCE does not already protect: the code is useless without the verifier, which never leaves the printer. The FAPI 2.0 Message Signing profile makes exactly that argument. Signed authorization responses are one of the features it defines, each tested for conformance separately, so an ecosystem chooses whether to use them; a server that offers them must require and issue them. It says encrypting them is not needed and not recommended, since a code-only response has nothing in it to hide.

What a signature cannot tell

A signature proves who wrote a response and for which client. It cannot prove which browser session the response belongs to.

Return to the forged callback from Request correlation and CSRF, this time with JARM in place. The attacker connects their own photo account in their own browser and stops just before the callback. The photo service has produced a perfectly genuine, signed response: issued by the photo service, addressed to photo-printer, unexpired. When the attacker gets Ava's browser to deliver it to the printer, every JARM check passes. What stops the attack is what stopped it before: the state inside does not match a pending attempt in Ava's session, and the code cannot be exchanged without the attacker's verifier.

code, state, iss

Written by the photo service
Claimed by iss
Meant for photo-printer
Not stated
Ava's attempt
state and PKCE match

Used after state and PKCE

One signed JWT

Written by the photo service
Proved by the signature
Meant for photo-printer
aud: photo-printer
Ava's attempt
state and PKCE match

Used after every check

Attacker's own response

Written by the photo service
Proved by the signature
Meant for photo-printer
aud: photo-printer
Ava's attempt
No, state differs

Refused by state and PKCE

A signature proves who wrote a response and for which client, not which browser session it belongs to.

A signed response proves who wrote it and for which client. Only state and PKCE tie it to Ava's attempt, so the attacker's genuine response is refused by those checks, not by the signature.

So JARM adds to the printer's checks rather than replacing any of them. It also adds less evidence than the signed request did. A signed request records what a client asked for, such as a payment of 42.50 EUR. A signed response records a code and a state, values that only mean something inside one protocol exchange.

That balance explains where JARM is used. As with request objects, the FAPI profiles moved from requiring signed responses to offering them. FAPI 1.0 Advanced required them. The FAPI 2.0 Security Profile keeps the response to a code protected by PKCE and the iss parameter, and leaves JARM to its message signing profile for deployments that want every message signed.

Check your understanding

Try these questions before moving on. If an answer isn't right, use the feedback and try again.

An attacker runs the printer's flow with their own photo account and gets Ava's browser to deliver the genuine, signed JARM response to the printer. Which check stops the attack? 1 of 3

Choose one answer.

The printer sends response_mode=jwt with response_type=code. How does the response arrive? 2 of 3

Choose one answer.

The photo service signs responses with an elliptic curve key and lists only ES256. A new client asks for response_mode=jwt but never set authorization_signed_response_alg. What is likely to go wrong? 3 of 3

Choose one answer.

Try it in the Lab

We value your privacy

We use cookies and similar technologies to enhance your browsing experience, and analytics to understand our traffic. By clicking "Allow all", you consent to optional analytics. Cookie Policy

Learn identity