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

Get and Set global filterMode using the /realm-config/agents/J2EEAgent endpoint does not work as expected

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 14.1.1, 14.5.1, 6.0.0
    • Fix Version/s: None
    • Component/s: API descriptor, rest
    • Labels:
    • Target Version/s:
    • Rank:
      1|hzusjr:
    • Sprint:
      AM Sustaining Sprint 53, AM Sustaining Sprint 54, AM Sustaining Sprint 55
    • Story Points:
      1
    • Support Ticket IDs:

      Description

      Bug description

      A GET on the /realm-config/agents/J2EEAgent endpoint does not work as expected where when setting the global 'Agent Filter Mode' option to a value other than ALL then the value is not returned by the endpoint.

      Conversely when using PUT on the same endpoint to update this does not allow the setting of a global value other than ALL.

      How to reproduce the issue (GET)

      1). Create a J2EE agent profile

      2). Use the API explorer to send the following request or send manually:

      curl -X GET --header 'Accept: application/json' 'http://openam.example.com:8080/AM6/json/realm-config/agents/J2EEAgent/testj2ee

      3). The response contains:

       "filterMode": {
            "inherited": false,
            "value": {
              "": "ALL"
            }
          },

      4). Using the admin UI adjust the agent profile so that the Agent Filter Mode is set to, for example, global SSO_ONLY by leaving the Map Key empty and setting the Map Value to SSO_ONLY (remove the default ALL entry).

      5). Execute the curl request again and note the results:

       "filterMode": {
            "inherited": false,
            "value": {}
          },
      Expected behaviour
       "filterMode": {
            "inherited": false,
            "value": {
              "": "SSO_ONLY"
            }
          },
      Current behaviour
      "filterMode": {
            "inherited": false,
            "value": {}
          },
      

       

      How to reproduce the issue (PUT to update)

      1). Using the admin UI set the global value to SSO_ONLY and then use the API explorer to send the following request or send manually to set it back to global ALL:

      curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ \
         "globalJ2EEAgentConfig": { \
          \
           "filterMode": { \
             "inherited": false, \
             "value": {"": "ALL"} \
           } \
       } \
       }' 'http://openam.example.com:8080/AM6/json/realm-config/agents/J2EEAgent/testj2ee

      This succeeds as expected.

      2). Now try to set this to global SSO_ONLY by sending:

      "filterMode": { \
             "inherited": false, \
             "value": {"": "SSO_ONLY"} \
           }

      This fails with the following response rather than overwriting ALL:

      {
        "code": 400,
        "reason": "Bad Request",
        "message": "Data validation failed for the attribute, com.sun.identity.agents.config.filter.mode"
      }

      3). Verify using the admin UI that the value is still set to ALL

      4). Using the admin UI try to set it to SSO_ONLY and note that this now fails with the following error:

      Plug-in com.sun.identity.idm.plugins.internal.AgentsRepo: Error while setting attributes for agentonly=testj2ee

       

      Note 6.0 SNAPSHOT version tested was 16 November 2017

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              yaodong.hu Yaodong Hu [X] (Inactive)
              Reporter:
              andy.itter Andy Itter
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: