Skip to content
Workforce IdentityMarkdown

Signed request objects

The app signs its sign-in request with its own key, can encrypt it to the realm, and can have the answer posted back instead of placed in the address bar.

AvailableAPIRFC 9101, RFC 10070, OpenID Connect Core 1.0 §6, OAuth 2.0 Form Post Response Mode, RFC 7516, RFC 7518 §4.6

A signed request object is the app’s sign-in request as a JWT signed with the app’s own key. The realm reads only what is inside the signed part, so no one handling the URL can add to or change what the app asked for, even when the request travels through the browser. The app can also encrypt the object to the realm, so nothing that carries it can read it, and can have the code posted back to it rather than placed in the address bar.

  • Sign when the app must prove the request is exactly its own, even if it travels through the browser.
  • Encrypt when the request carries details no one on the way should read, and it travels through the browser. Inside a pushed request it already travels only between the app and the realm, so encryption adds little there.
  • Form post when the app would rather not have the code in browser history or server logs.
  • Who can do it: a realm administrator (a group holding RealmOwner) registers the client’s algorithms and keys; RealmViewer can read them. The app signs each request itself.
  • Where: today this is done through the API (Call the API shows how to get $CVYUH_SESSION).
  • First: the app holds a signing key whose public half is in its jwks or at its jwksUri.

The app puts the sign-in parameters in the claims of a JWT, beside the claims that say who sent it, to whom, and for how long:

{
"iss": "team-wiki",
"aud": "https://foobar.cvyuh.com/oauth2",
"client_id": "team-wiki",
"nbf": <unix time>,
"exp": <nbf + 300>,
"jti": "4d6f1c2e-8b3a-4f9e-a1c7-5e2b9d0f7a31",
"response_type": "code",
"redirect_uri": "https://wiki.example.com/callback",
"scope": "openid profile",
"state": "af0ifjsldkj",
"code_challenge": "E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM",
"code_challenge_method": "S256"
}

It signs the JWT with its own key, under the algorithm it registered, and sends it as request. The client_id outside the object is still needed, because it tells the realm whose keys to check the signature with:

GET /oauth2/authorize?client_id=team-wiki&request=eyJhbGciOiJFUzI1NiIsImtpZCI6Indpa2ktMSJ9.eyJpc3MiOi…
Host: foobar.cvyuh.com

The object can travel in the browser like this, or inside a pushed request.

Encryption. An encrypted request object is a signed one the app has also encrypted to the realm’s own key. The realm opens it first and then checks it exactly as a signed one; encryption never stands in for the signature. Every realm that signs tokens holds an encryption key of its own, never its signing key. It is published in the realm’s key set (/oauth2/jwks) with "use": "enc" and "alg": "ECDH-ES".

Form post. To have the code posted back, the app sends response_mode=form_post, or puts "response_mode": "form_post" among the object’s claims. Instead of a redirect with the code in the address bar, the browser posts the code to the app’s registered address. It needs no setting.

Set these on the client (https://foobar.cvyuh.com/api/v0/am/objects/v1/oauth2Client; see Call the API):

WhereSettingWhat it does
ClientrequestObjectSigningAlgES256, RS256 or PS256. A client with securityProfile fapi2 may name only ES256 or PS256. Without it, signed requests are refused
Clientjwks or jwksUriThe client’s public keys, to check the signature
ClientrequestObjectEncryptionAlgECDH-ES, the one key agreement taken. Needs requestObjectSigningAlg
ClientrequestObjectEncryptionEncA128GCM, A256GCM or A128CBC-HS256. Left out, A128CBC-HS256, as OpenID Connect Registration sets. Named only beside the key agreement

Nothing different with a good object. A refused one shows the realm’s error page, with invalid_request_object; the user goes back to the app and tries again. With form post, the browser shows a brief page that posts the code to the app.

Setting or limitDefaultRange
requestObjectSigningAlgnone: signed requests refusedES256, RS256, PS256 (ES256, PS256 under fapi2)
requestObjectEncryptionAlgnoneECDH-ES
requestObjectEncryptionEncA128CBC-HS256A128GCM, A256GCM, A128CBC-HS256
Between nbf and expat most an hour
SymptomCauseFix
request_not_supportedThe client registered no requestObjectSigningAlgRegister the algorithm the app signs with
invalid_request_objectaud isn’t the issuer alone, nbf or exp is missing or over an hour apart, the key isn’t registered, or a jti was reusedCheck those claims; register the key
invalid_requestNo client_id outside the objectSend client_id as a parameter too

A request object writes no record of its own; the sign-in it starts writes LOGIN and its steps, and its code a TOKEN_ISSUED record. Changes to the client’s algorithms are in Audit → Config.

  • The object must be signed with the algorithm the client registered, with the client’s own key.
  • It must name the client as its sender and the realm as its only receiver. iss is the client; aud is the realm’s issuer as a string, or an array holding the issuer alone, never the issuer beside another audience.
  • It must carry both a start (nbf) and an expiry (exp), no more than an hour apart.
  • client_id goes outside the object as well. A client_id inside the object that differs from it is refused.
  • An object that carries a jti is accepted once.
  • An encrypted object is taken only from a client registered for encryption, under the one content encryption it registered, and must hold a signed object. An unsigned one inside is refused. A client registered for encryption may still send its object signed only.
  • Every refused encrypted object gets the same answer, invalid_request_object, whatever went wrong, so the answer says nothing about the key.
  • A form post goes only to an address the client registered.
  • The realm’s encryption key is made when the realm is created; it is not rotated or revoked yet. The discovery document lists request_object_encryption_alg_values_supported and request_object_encryption_enc_values_supported only while the realm holds one and takes the authorization code grant.
  • RSA key encryption (RSA-OAEP) is not offered.

At /authorize, a refused object is shown on the realm’s error page. It is never sent to the app’s return address, since nothing in an object that failed its checks can be trusted. Inside a pushed request, the same error is the push’s answer.

ErrorWhen
request_not_supportedThe client registered no requestObjectSigningAlg
invalid_request_objectThe signature, a claim or the encryption doesn’t check out; the jti was used before; or the inner client_id differs
invalid_requestThe request carries no client_id outside the object