Everything broke after last night's change window
Last night's print orders never went out, and a change window made three changes by three people. This lesson follows one fresh attempt stage by stage, finds two faults in the order the requests reveal them, rules out a change that only looks guilty, and repairs one cause at a time without undoing the window's deliberate changes.
Last night's orders never went out
The message from the printing company's shift lead is waiting when you start: "Last night's print orders never went out. Nothing works. There was a change window yesterday evening, so it's probably that."
The integration in question is the printing company's evening order run. At 23:30 each night a backend job, registered at the photo service as the confidential clientAn OAuth client, typically running on a backend, that can keep a credential such as a client secret or private key protected, and so can authenticate itself to the authorization server. printer-evening-orders, gets an access tokenA token that a client presents to an API to use access it has been granted, usually limited in what it allows and how long it lasts. It authorizes API calls; it does not tell the client who signed in. from auth.photos.example with the client credentials grant, then reads the day's ready print orders and their photos from api.photos.example. No user is involved. The job acts on its own authority, which is why it authenticates with a client secretA shared secret that a confidential client uses to prove itself to the authorization server, much like a password for an application. It belongs on a backend, never in code sent to browsers or phones..
The change window ran from 21:00 to 23:00, and the change record lists three entries by three people:
CHG-4471 21:04 Anika Rotated client secret for printer-evening-orders. Overlap: none.
New secret stored as version 8 in the deployment vault.
CHG-4473 21:40 Kenji Photo API now accepts tokens for resource https://api.photos.example/v2 only.
Client configurations updated: printer-web, photos-mobile.
CHG-4478 22:15 Greta Disabled client photos-export-legacy (no requests in 90 days).Any of these could be the cause, more than one could be, and "it's probably that" is a starting point, not a finding. Before you read the change record closely, pin down what should have happened: which client, which tokenA piece of data issued by a trusted service that a client presents as a credential, for example to call an API or to report a sign-in. Some tokens carry readable claims; others are random strings that only the issuer can interpret. request, which APIAn application programming interface: a defined way for software to interact with a service. A web API offers endpoints where other programs send HTTP requests. call, in production, at 23:30. Then follow one fresh attempt and let the requests tell you where they stop. The method from Finding the failing stage applies as it is. What this incident adds is more than one fault.
Start where the requests stop
The job's run has two stages that can fail: getting the token, then using it. Run the token request by hand with the configuration the job has deployed, and it fails at the first one:
POST /token HTTP/1.1
Host: auth.photos.example
Authorization: Basic <redacted>
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials&scope=prints.read&resource=https%3A%2F%2Fapi.photos.example
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Basic realm="auth.photos.example"
Content-Type: application/json
Cache-Control: no-store
X-Request-ID: 3b9e1f70-5a2c-4d86-8e14-c7a0d2f96b53
{"error": "invalid_client", "error_description": "Client authentication failed."}OAuth 2.0A framework that lets a person give an application limited access to their resources at another service, using tokens instead of sharing their password. OAuth is about access; OpenID Connect adds sign-in. defines invalid_client as failed client authenticationChecking evidence that someone, or some application, controls an account, such as a password or a passkey. It establishes which account is being used, not what that account may do.: an unknown client, a wrong credential, or an unsupported authentication method. Because the client tried to authenticate with HTTPThe Hypertext Transfer Protocol, the rules browsers, apps, and servers use to send requests and responses on the web. Basic, the token endpointThe authorization server address where clients exchange an authorization code, refresh token, or other grant for tokens, in a direct request rather than through a browser redirect. answers 401 and challenges with WWW-Authenticate: Basic. Notice what this request has not reached. The server stops at client authentication, before it looks at the requested scope or the resource parameter, and long before any API call. Anything else that is wrong with the run is still invisible.
That is why the order matters. A request refused at the first stage can hide a second fault at the next one. Fix the first, and the same request moves forward and may be refused again further on: by the token endpoint itself, for example with invalid_scope if a release added a scope the client cannot have, or by the API. A new refusal after a repair usually means progress, so investigate each stage in the order the requests reveal it, and resist fixing things you cannot yet see fail.
Match each change to what is failing
Now the change record is useful, because you know which component to compare it with. The failing component is client authentication for printer-evening-orders. Two changes in the window touched client authentication, and only one of them names that client.
The photo service's audit record for your request settles it:
time 2026-10-20T08:12:02.118Z
operation oauth.token
outcome rejected
reason client_secret_mismatch
client printer-evening-orders
detail presented secret matches retired version 7; current version 8 active since 21:04
request_id 3b9e1f70-5a2c-4d86-8e14-c7a0d2f96b53CHG-4471 replaced this client's secret with no overlap, so the old value stopped working at 21:04, and the job is still presenting the old value. Version 8 went into the vault and nobody deployed it to the job. The subject of the change, the reason in the audit record and the client in the failing request all line up.
CHG-4478 is the tempting one. It disabled a client, it happened in the same window, and a disabled client is also refused with invalid_client, so it produces the very error you are looking at. But it names photos-export-legacy, and the failing request comes from printer-evening-orders. The audit reason is a secret mismatch, not a disabled client, and the legacy client made no requests in 90 days. A change explains a failure only when what it names is the component that is failing. Being in the window is not enough, so CHG-4478 stays as it is. Re-enabling it would revive a client nobody uses and fix nothing.
CHG-4473 names the photo API, a later stage that the run has not reached yet. Note it and leave it. You will know soon whether it matters.
One repair at a time
Write each change down before you make it, in a small ledger: the hypothesis, the evidence for it, the change, the result, and a request that must still fail afterwards. The last column is what stops a repair from quietly becoming a bypass.
The first repair is to deploy secret version 8 to the job. Bringing version 7 back would revive a credential the window meant to retire. Send the same token request with the current secret, and it succeeds. Decode the token's claims to see what the job now holds:
{
"iss": "https://auth.photos.example",
"sub": "printer-evening-orders",
"aud": "https://api.photos.example",
"client_id": "printer-evening-orders",
"scope": "prints.read",
"iat": 1792484050,
"exp": 1792484650,
"jti": "<redacted>"
}Then run the job's first API call with it. The request gets one stage further and is refused there:
GET /print-orders?status=ready HTTP/1.1
Host: api.photos.example
Authorization: Bearer <redacted>
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Bearer error="invalid_token", error_description="The token audience is not accepted by this API"
X-Request-ID: e4c87a1d-2f59-4b03-91d6-6a3f0b8e5c27This is the second fault, now visible, and not a sign that the first repair failed. The aud (audience) claim names the resource the token was issued for. The job asks for a token for https://api.photos.example through the resource parameter defined in RFC 8707, and the authorization serverIn OAuth, the service that handles a person's sign-in and approval and decides which tokens to issue to a client. It may belong to the same company as the API, but its job is separate. still issues one. But since CHG-4473 the photo API accepts only tokens whose aud is https://api.photos.example/v2, and it refuses the rest as invalid for this API. The change record's list of updated clients does not include printer-evening-orders. The migration was deliberate; this integration was missed.
So the second repair belongs in the job's configuration, not the API: request resource=https://api.photos.example/v2. Every client allowed prints.read can already ask for the new identifier. Asking the API team to accept the old audience again would undo a deliberate change to rescue one missed configuration. Had the change record shown the API moved by mistake, with no migration planned, the repair would run the other way: point the API back at its own resource. Which side to repair follows from which change was intended.
Prove the whole original operation
A token is one stage of the run, and the run is what failed. Get a fresh token with the new secret and the new resource identifier, confirm that its aud is https://api.photos.example/v2, and then run the whole job: it reads the ready orders, fetches their photos and submits last night's fourteen orders. Use a freshly issued token for this. A token obtained before the rotation can stay valid until it expires, and a test that happens to reuse one proves nothing about the deployed configuration.
Then prove that the boundaries the window touched still hold. A token request with retired secret version 7 is still refused with invalid_client. A token for the old audience is still refused by the API. photos-export-legacy is still disabled. Recovery means the original work succeeds and none of last night's deliberate changes were undone to get there.
Worked example: the repair ledger
The finished ledger tells the next engineer what was wrong, what proved it, what changed and what still fails, including the change that was ruled out:
| Hypothesis | Evidence | Change | Result | Request that must still fail |
|---|---|---|---|---|
| The job presents the secret retired by CHG-4471. | Token endpoint 401 invalid_client; audit reason client_secret_mismatch for printer-evening-orders, matching retired version 7 (request 3b9e1f70-...). | Deployed secret version 8 to the job. | Token issued. API now refuses it: 401 invalid_token, audience not accepted. | Token request with version 7: 401 invalid_client. |
| CHG-4478 disabled the job's client. | Ruled out: CHG-4478 names photos-export-legacy; the failing request is printer-evening-orders; reason is a secret mismatch, not a disabled client. | None. | Not applicable. | photos-export-legacy stays disabled. |
| The token's audience no longer matches the API after CHG-4473. | Token aud is https://api.photos.example; API expects https://api.photos.example/v2; job not in CHG-4473's updated clients (request e4c87a1d-...). | Job requests resource=https://api.photos.example/v2. | Token aud is the new identifier; full run submits 14 orders. | Token for the old audience: API 401 invalid_token. |
Its handoff line is short: two faults from two changes, found in the order the stages revealed them, one plausible change ruled out by comparing its subject with the failing client, two narrow repairs, the original run complete and every retired or replaced path still refused. No secret values appear anywhere in it, only version numbers and request IDs.
Check your understanding
Try these questions before moving on. If an answer isn't right, use the feedback and try again.
Try it in the Lab
- Recover the integration after the change windowAn evening integration breaks after a change window you did not run. Find its faults in the order the stages reveal them, rule out the decoy change, repair one cause at a time and hand off a clear ledger.