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

json/agents/?_action=create returns inconsistent error codes when an agent name already exists

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 12.0.0, 12.0.2, 12.0.3
    • Fix Version/s: 12.0.3, 13.0.0
    • Component/s: rest
    • Sprint:
      AM Sustaining Sprint 13
    • Support Ticket IDs:

      Description

      A call to json/agents/?_action=create does not do a case insensitive check on agent names when looking for one that already exists.

      To reproduce, create an Agent with:

      curl \
      --request POST \
      --cookie "iPlanetDirectoryPro=$IPLANET" \
      --header "Content-Type: application/json" \
      --data \
      '{
      "username":"test",
      "realm":"/",
      "agenttype":["WebAgent"],
      "serverurl":"http://openam.example.com:8080/openam",
      "agenturl":"http://agent.example.com:80",
      "userpassword":"cangetin"
      }' \
      $METHOD://$HOST:$PORT/openam/json/agents/?_action=create
      

      Calling the same command again returns:

      {"code":409,"reason":"Conflict","message":"Resource already exists"}
      

      Changing the case on the username ("username":"Test"), then calling again returns a different result:

      {"code":400,"reason":"Bad Request","message":"Resource cannot be created: Plug-in com.sun.identity.idm.plugins.internal.AgentsRepo: Unable to create agent."}
      

        Attachments

          Activity

            People

            • Assignee:
              sachiko Sachiko Wallace
              Reporter:
              andrew.dunn Andrew Dunn [X] (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: