Uploaded image for project: 'OpenAM'
  1. OpenAM
  2. OPENAM-10337

PUT to /json/global-config/realms/ fails if Accept-API-Version is missing/doesn't specify Protocol.

    XMLWordPrintable

    Details

    • Rank:
      1|hzsq0v:

      Description

      In trying to document the new REALMS endpoint I hit the following oddity. The endpoint requires that you set the protocol to 1.0, otherwise you get a cryptic error message. Also, the protocol version is not returned in the headers. Happens from within API Explorer, and Postman.

      Repro:

      curl -X PUT -H "Content-Type: application/json" -H "iPlanetDirectoryPro: AQIC5wM2LY4SfcxrKz1A2lvPMFPIUAcbG3i8sAMfshO_yTo.*AAJTSQACMDEAAlNLABQtNjgyODI2ODk4NzA0NzI5NjkzMAACUzEAAA..*" -H "Cache-Control: no-cache" -d '{
            "_id": "Lw",
            "parentPath": "",
            "active": true,
            "name": "/",
            "aliases": [
              "openam.example.com",
              "openam"
            ]
          }' "http://openam.example.com:8080/openam/json/global-config/realms/Lw"
      

      Expected result:

      HTTP 200

      {
          "_id": "Lw",
          "parentPath": null,
          "active": true,
          "name": "/",
          "aliases": [
              "openam.example.com",
              "openam"
          ]
      }
      

      Actual Result:

      HTTP 501 Not Implemented

      Headers:

      Cache-Control →no-cache
      Connection →close
      Content-API-Version →resource=1.0
      Content-Type →application/json;charset=UTF-8
      Date →Thu, 05 Jan 2017 16:19:38 GMT
      Transfer-Encoding →chunked
      X-Frame-Options →SAMEORIGIN

      JSON response:

      {
        "code": 501,
        "reason": "Not Implemented",
        "message": "Cannot provide ID for Realm resource"
      }
      

      Some other notes:

      • My REST API version was set to use "Latest". I'm told protocol 2.0 is being used by the REALMS endpoint.
      • If you specify in the global REST config that a warning header should be included if Accept-API-Version is not specified, API Explorer no longer works.
      • You can set your top-level realm to Inactive via REST, which the XUI prevents you from doing, as it locks you out of OpenAM.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              chris.lee Chris Lee
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated: