Uploaded image for project: 'Keycloak'
  1. Keycloak
  2. KEYCLOAK-4853

Created responses should include the unique ID of the object created

    XMLWordPrintable

Details

    • Enhancement
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Done
    • None
    • 3.4.2.Final
    • None
    • None
    • NEW
    • ASSIGNED

    Description

      When creating arbitrary objects via the admin API, its noticed that while a 201 Created comes back, there is no identifier for that object coming back. Most of the APIs need that ID to uniquely look up the object. While we could query to get the list back, its slower than having the ID to get a single object.

      It would be beneficial to include some response value, possibly an ETag to comply with HTTP/1.1's recommendation:

      10.2.2 201 Created

      The request has been fulfilled and resulted in a new resource being created. The newly created resource can be referenced by the URI(s) returned in the entity of the response, with the most specific URI for the resource given by a Location header field. The response SHOULD include an entity containing a list of resource characteristics and location(s) from which the user or user agent can choose the one most appropriate. The entity format is specified by the media type given in the Content-Type header field. The origin server MUST create the resource before returning the 201 status code. If the action cannot be carried out immediately, the server SHOULD respond with 202 (Accepted) response instead.

      A 201 response MAY contain an ETag response header field indicating the current value of the entity tag for the requested variant just created, see section 14.19.

      (from https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html )

      Attachments

        Activity

          People

            Unassigned Unassigned
            meetoblivion_jira John Ament (Inactive)
            Mark True Mark True (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: