restscimscim2

Can we use the "request" returnable property of SCIM attribute even in GET request?


The SCIM RFC 7643 section-7 describes the schema definitions, the "returned" expects one of the following as the value:-

  1. always
  2. never
  3. default - The attribute is returned by default in all SCIM operation responses where attribute values are returned. If the GET request "attributes" parameter is specified, attribute values are only returned if the attribute is named in the "attributes" parameter.
  4. request - The attribute is returned in response to any PUT, POST, or PATCH operations if the attribute was specified by the client (for example, the attribute was modified). The attribute is returned in a SCIM query operation only if specified in the "attributes" parameter.

My question is around "default" and "request" values. I have use-case where the attribute should be returned in GET request, only if requested explicitly in query parameters using "attributes". I see in the "request" property description that, the behavior I am expecting is only possible for "POST", "PATCH" AND "PUT". Can I use this even for GET?

References - enter link description here


Solution

  • Yes, you can. In the description of "request" returned type, it mentions,

    The attribute is returned in a SCIM query operation only if specified in the "attributes" parameter.

    SCIM Query operation includes both

    The inclusion of "/.search" on the end of a valid SCIM endpoint SHALL be used to indicate that the HTTP POST verb is intended to be a query operation

    So, If you have any attributes with "returned" characteristics = "request", those will be returned in your query operation's response only if you specify those in "attributes" in your scim resource query request.