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

Site REST API Call Does Not Allow Servers Value into Payload

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 14.5.0, 14.5.1, 6.0.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Rank:
      1|hzw1ov:
    • Support Ticket IDs:

      Description

      Bug description

      The Site REST API does not allow server value to be place in the request payload.This caused an error message to be displayed should the server value to be place in the request payload.

      How to reproduce the issue

      1. Obtain Server ID and Server URL
      2. Using site REST API call (POST /global-config/sites PUT /global-config/sites/{sitesId}) to create the site
      EXPECTED BEHAVIOUR
      curl -X PUT \
      http://am.example.com:8080/openam/json/global-config/sites/test \
      -H 'Content-Type: application/json' \
      -H 'iplanetdirectorypro: NQ7jWNCqrE2Wl3v0lvR2XcDPL-s.*AAJTSQACMDEAAlNLABxqSWd5UWFjbW5UOHlwYXdwdXBSMmMxdDF2Ujg9AAR0eXBlAANDVFMAAlMxAAA.*' \
      -d '{
      "_id" : "test",
      "url" : "http://am.example.com",
      "secondaryURLs" : [],
      "servers": [
      {
      "id": "01",
      "url": "http://am.example.com:8080/openam"
      }
      ]
      }'
      
      
      {
        "_id": "test",
        "_rev": "844299344",
        "id": "02",
        "url": "http://am.example.con:8080/openam",
        "secondaryURLs": [],
        "servers": [
          {
            "id": "01",
            "url": "http://am.example.com:8080/openam"
          }
        ]
      }
      
      
      CURRENT BEHAVIOUR
      curl -X PUT \
      http://am.example.com:8080/openam/json/global-config/sites/test \
      -H 'Content-Type: application/json' \
      -H 'iplanetdirectorypro: NQ7jWNCqrE2Wl3v0lvR2XcDPL-s.*AAJTSQACMDEAAlNLABxqSWd5UWFjbW5UOHlwYXdwdXBSMmMxdDF2Ujg9AAR0eXBlAANDVFMAAlMxAAA.*' \
      -d '{
      "_id" : "test",
      "url" : "http://am.example.com",
      "secondaryURLs" : [],
      "servers": [
      {
      "id": "01",
      "url": "http://am.example.com:8080/openam"
      }
      ]
      }'
      
      
      {
      "code": 400,
      "reason": "Bad Request",
      "message": "Only url, secondaryURLs and _id are valid in write"
      }
      

      Work around

      Remove the server value from the payload before executing the REST API call:

       

      curl -X PUT \
      http://am.example.com:8080/openam/json/global-config/sites/test \
      -H 'Content-Type: application/json' \
      -H 'iplanetdirectorypro: NQ7jWNCqrE2Wl3v0lvR2XcDPL-s.*AAJTSQACMDEAAlNLABxqSWd5UWFjbW5UOHlwYXdwdXBSMmMxdDF2Ujg9AAR0eXBlAANDVFMAAlMxAAA.*' \
      -d '{
      "_id" : "test",
      "url" : "http://am.example.com",
      "secondaryURLs" : []
      }'
      
      {
        "_id": "test",
        "_rev": "-946376211",
        "id": "02",
        "url": "http://am.example.com",
        "secondaryURLs": [],
        "servers": []
      }
      

       

      Followed by manually add the server to the site (Deployment > Server > [Server name] > General > Site > Parent Site).

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            wanning.tan WanNing Tan
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: