Provisioning reads accounts but cannot change them
Gwen Abara's account should have been activated on her first morning, and the provisioningCreating accounts in applications, keeping their attributes and access current, and disabling them when people leave, without waiting for each person to sign in. SCIM is a standard way to send those changes. connector reads every account without an error. This lesson follows the one change she needed through a 403, a 409 and a 412, separates reading an account from changing it, and repairs the change with the approved writer on the same record without ever creating a second account.
The change is visible in HR, but not in the application
Gwen Abara starts at the printing company on Monday. By ten o'clock her manager has opened a ticket: "Gwen can't sign in to the photo workspace. HR says her account was activated this morning. Can someone look?" The HR system agrees. Its record for Gwen shows her start date, her status as active, and a note that the change was sent to the photo workspace at 06:00.
The printing company's staff use a business workspace at the photo service, and nobody creates those accounts by hand. The HR system's connector keeps them in step using SCIMThe System for Cross-domain Identity Management: a standard shape for users and groups and a standard set of HTTP requests for creating, changing, and disabling accounts in applications., the standard 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. for provisioning users. When an offer is accepted, the connector creates an inactive account. On the start date, it sends a change that sets the account active. When someone leaves, it sets the account inactive again.
The connector's operator has already checked the obvious thing. "The connection is healthy. It reads every account in the workspace without a single error." That is true, and it is less reassuring than it sounds. Reading an account and changing one are different operations, and a connection test that only reads proves the first. Follow the actual change Gwen needed, the way the method from Finding the failing stage follows any other request.
Find the record the change was meant for
Before you look at why a write failed, make sure you are looking at the right record. A display name or a partial email search can turn up several people, and finding a likely-looking account does not entitle anyone to change it. SCIM gives each user two stable handles: the id, which the photo service assigned when it created the account, and the externalId, which the HR system supplied as its own reference for the person. The connector stores both. Here is the read it made on Friday evening, when it queued her start-date change:
GET /scim/v2/Users/2819c223-7f76-453a-919d-413861904646 HTTP/1.1
Host: api.photos.example
Authorization: Bearer <redacted>
Accept: application/scim+json
HTTP/1.1 200 OK
Content-Type: application/scim+json
ETag: W/"a330bc54f0671c9"
{
"schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
"id": "2819c223-7f76-453a-919d-413861904646",
"externalId": "hr-40217",
"userName": "[email protected]",
"name": {"givenName": "Gwen", "familyName": "Abara"},
"active": false,
"meta": {
"resourceType": "User",
"created": "2026-10-02T09:14:27Z",
"lastModified": "2026-10-02T09:14:27Z",
"version": "W/\"a330bc54f0671c9\""
}
}One account, the right person, still inactive, and unchanged since it was created on 2 October. The ETag header and meta.version carry the same value: the version of the record the connector just read. Then the connector's own log shows what happened at 06:00 on Monday, when it sent the change with that version:
PATCH /scim/v2/Users/2819c223-7f76-453a-919d-413861904646 HTTP/1.1
Host: api.photos.example
Authorization: Bearer <redacted>
Content-Type: application/scim+json
If-Match: W/"a330bc54f0671c9"
{
"schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
"Operations": [{"op": "replace", "path": "active", "value": true}]
}
HTTP/1.1 403 Forbidden
Content-Type: application/scim+json
WWW-Authenticate: Bearer error="insufficient_scope", scope="scim.users.write"
X-Request-ID: 0b6d2f71-4e8a-4c39-a5f0-9d17c3e2b846
{
"schemas": ["urn:ietf:params:scim:api:messages:2.0:Error"],
"status": "403",
"detail": "The access token does not permit changes to users."
}The request is well formed. If-Match carries the version the connector read, so the photo service would apply the change only if nobody had altered Gwen's record since. The answer is a 403 in the SCIM error format: the schemas value names the error message type, status repeats the HTTPThe Hypertext Transfer Protocol, the rules browsers, apps, and servers use to send requests and responses on the web. status as a string, and detail explains it in words. RFC 7644 uses 403 for an operation the supplied authorizationDeciding whether a requested action is permitted, such as whether a signed-in account may delete a particular photo. Authentication says which account is asking; authorization decides what it can do. does not permit. The WWW-Authenticate header, which RFC 6750 defines for bearer tokens, is more specific still: insufficient_scope means the 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. was valid but lacked the scope this operation needs, and scope="scim.users.write" names that scope. Not every server sends this header, so read the error body either way.
A 403 is not the only refusal a provisioning change can meet, and the others need different repairs. A 412 Precondition Failed means the record changed after the version in If-Match was read, as RFC 7644 section 3.14 describes. A 409 Conflict with "scimType": "uniqueness" means a value that must be unique, such as userName, is already taken. A 400 Bad Request usually carries a scimType that names the problem with the request itself. This one is plainly the first kind: the photo service understood the change and refused to let this caller make it.
Read access is not write access
The photo service's audit record for the refused request names the client that made it:
time 2026-10-19T06:00:03.417Z
operation scim.user.patch
outcome rejected
reason insufficient_scope (scim.users.write)
client hr-sync-reader (scopes: scim.read)
object user 2819c223-7f76-453a-919d-413861904646 (externalId hr-40217)
request_id 0b6d2f71-4e8a-4c39-a5f0-9d17c3e2b846The connector is supposed to run as hr-sync, the approved writer, whose tokens carry scim.read and scim.users.write. It ran as hr-sync-reader, a client created for a reporting dashboard that only ever needs to look. The connector's change history explains how. Ten days ago, during a credential clean-up, someone replaced the connector's client credentials and picked the reader by mistake. Since then every read has worked, and the only write due in that time was Gwen's activation.
Nothing is broken in the reader. It is doing exactly what it was set up to do, and the photo service is enforcing exactly what it should. Scopes are separate grants: scim.read lets a client look at users, scim.users.write lets it change them, and holding one says nothing about the other. The same goes for the boundaries between writers. A client that can change users has no right to change group memberships unless it holds that scope too, and a field owned by another system, such as a cost center maintained by the finance system, should stay out of reach of an HR connector that happens to be able to edit other attributes.
There are two tempting ways to make the error disappear, and both are wrong. Adding scim.users.write to the reader would quietly turn a dashboard credential into one that can activate and deactivate staff. Switching the connector to a broad administration client would work and would hand a scheduled job far more authority than it needs.
Repair with the approved writer
Point the connector back at hr-sync, the client approved for this job, with only the scopes it needs. Then let it make Gwen's change again, to the same id, with version protection intact.
Something happened earlier this morning that the repair has to respect. At 09:30, before the ticket reached you, a colleague on the help desk tried a workaround and asked the photo service to create Gwen's account again:
POST /scim/v2/Users HTTP/1.1
Host: api.photos.example
Authorization: Bearer <redacted>
Content-Type: application/scim+json
{"schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
"userName": "[email protected]", "externalId": "hr-40217", "active": true}
HTTP/1.1 409 Conflict
Content-Type: application/scim+json
{
"schemas": ["urn:ietf:params:scim:api:messages:2.0:Error"],
"scimType": "uniqueness",
"status": "409",
"detail": "A user with this userName already exists."
}That conflict protected Gwen. RFC 7644 section 3.12 defines uniqueness for exactly this: one or more values are already in use. Had the colleague varied the userName to get past it, the photo service would have created a second account, and Gwen would have ended up with two identities in the workspace, one with HR's history and one without. The repair never creates an account. It changes the one that exists.
A few minutes later the same colleague added Gwen's desk phone number to her account, which changed her record's version. So when the repaired connector replays its queued PATCH with the If-Match it read on Friday, it gets this:
HTTP/1.1 412 Precondition Failed
Content-Type: application/scim+json
{
"schemas": ["urn:ietf:params:scim:api:messages:2.0:Error"],
"status": "412",
"detail": "The resource has changed since the version in If-Match."
}A 412 after a repair is progress, not a new outage: the 403 is gone, and the photo service is now protecting the record against a stale write. The right response is to read Gwen's record again, which returns version W/"5d19e7a3c2b80f4" with the phone number, check that activation is still the intended change, and send the PATCH with If-Match: W/"5d19e7a3c2b80f4". Dropping If-Match to force the write through would overwrite whatever changed, without anyone deciding to. This time the answer is 200 with "active": true and a new ETag.
One more rule matters whenever a provisioning write is retried. If a create request times out, you do not know whether the account was created. The request may have reached the photo service and committed just before the connection dropped. A timeout is an unknown outcome, not a failure, and the next step is to look before trying again. Search by the identifiers you control:
GET /scim/v2/Users?filter=externalId%20eq%20%22hr-40217%22 HTTP/1.1
Host: api.photos.example
Authorization: Bearer <redacted>
HTTP/1.1 200 OK
Content-Type: application/scim+json
{
"schemas": ["urn:ietf:params:scim:api:messages:2.0:ListResponse"],
"totalResults": 1,
"startIndex": 1,
"itemsPerPage": 1,
"Resources": [{"id": "2819c223-7f76-453a-919d-413861904646", "externalId": "hr-40217",
"userName": "[email protected]", "active": true}]
}One result means the create went through, so store its id and carry on. Zero results means it is safe to send the create again. If a service does not support filtering on externalId, a filter on userName does the same job.
Verify the state and its access consequences
Read Gwen's record back with the writer. It should show the same id, "active": true and the version from the successful PATCH. Run the externalId search too: exactly one result, so no duplicate slipped in along the way. The audit record for the successful change should name hr-sync as the client. Then ask Gwen to sign in.
Next, confirm that the boundaries still hold. Send the same PATCH with a token from hr-sync-reader. It must still get a 403 with insufficient_scope, because the dashboard client should never be able to change a user. Then send a PATCH as the writer with the version from before the repair. It must get a 412, because the record has moved on. A repair that made either of those succeed would have removed a protection rather than fixed a fault.
For a leaver the read-back needs one more step. Setting active to false stops new sign-ins to the workspace, but it does not by itself end sessions that are already open or revokeCancelling a credential, token, certificate, or authenticator before it would expire, so that it is no longer accepted. Whether every copy stops working at once depends on how services check it. tokens the person already holds. Check what your service does with those, so that a deactivation you have verified on the record also holds where the person is still signed in.
Worked example: the request ledger
A ledger of the requests, in order, shows exactly where the change stopped and how it was finished. It identifies each request by method, status and request ID and never includes a token:
Time (UTC) Client Request Result
2026-10-16 18:00 hr-sync-reader GET Users/2819c223... 200, version W/"a330bc54f0671c9"
2026-10-19 06:00 hr-sync-reader PATCH active=true, If-Match a330bc54 403 insufficient_scope (0b6d2f71...)
2026-10-19 09:30 help desk tool POST Users userName=gwen.abara@... 409 uniqueness, no duplicate created
2026-10-19 09:34 help desk tool PATCH phoneNumbers 200, version W/"5d19e7a3c2b80f4"
2026-10-19 10:31 hr-sync PATCH active=true, If-Match a330bc54 412, record changed at 09:34
2026-10-19 10:31 hr-sync GET Users/2819c223... 200, version W/"5d19e7a3c2b80f4"
2026-10-19 10:31 hr-sync PATCH active=true, If-Match 5d19e7a3 200, active=true
2026-10-19 10:33 hr-sync GET Users?filter=externalId eq hr-40217 totalResults 1
Cause: Connector credentials switched to the read-only reporting client on 2026-10-09.
Repair: Connector restored to hr-sync (scim.read, scim.users.write). No scopes added to the reader.
Verified: One active account for hr-40217. Reader PATCH still 403. Pre-repair version still 412.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
- Restore the missing account changeFind why an activation never arrived, repair it with the authorized writer on the same record and version, and keep the reader and a stale version refused.