User resource eTag

I see that the If-Match header is supported, as there is a dedicated error code for it (Okta API Error Codes | Okta Developer).

I want to implement optimistic locking for my users, so that two (possibly machine) users don’t modify the same user at the same time without knowing what the other did. When issuing a GET /users/{id}, I get an eTag in the response headers, and I can then use it to issue a POST /users/{id} (partial user update).

My problem is that I would have to keep track of the eTag somewhere. Since it seems to just be a sha-256 hash, is there a way that I could just compute it myself? All I would need to know is the data that is used to generate the eTag. For example, it could be a string built like “{userId}-{lastUpdated}”. It would be very helpful, since I would not have to forward the eTag to the client or store it anywhere.

I am sorry, but we do not have this information available.
Also, since the format of the eTag is not mentioned anywhere in our documentation, it can be subject to change at any point with new version releases.
We recommend going the rout of passing the tag to the client and storing it.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.