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

When creating Java/Web agent groups, some properties are not tag-swapped

    XMLWordPrintable

    Details

    • Yes

      Description

      Bug description

      When creating a java/web agent group, certain properties are set that have not been tag-swapped with values from the agent/server URL.

      How to reproduce the issue

      1. Create a new Java/Web agent group using the admin console
      Expected behaviour
      There are no properties that contain tags (e.g. @AGENT_PROTO@)
      Current behaviour
      Certain properties contain tags
      

      Work around

      Manually edit these properties after the agent has been created

      Code analysis

      The XUI does not send the "serverUrl" property as part of the creation payload. Because of this, the createInstance method calls the create method that does not carry out tag-swapping, i.e. 

      create(callerToken, realm, agentName, agentType, attributes);

      instead of 

      create(callerToken, realm, agentName, agentType, attributes, serverURL, agentURL);

      Code:

      org.forgerock.openam.core.rest.sms.SmsAbstractAgentProvider#createInstance
      ...
      if (agentType.equals(AgentConfiguration.AGENT_TYPE_J2EE) || agentType.equals(AgentConfiguration.AGENT_TYPE_WEB)) {
          attributes.put("AgentType", new HashSet<>(Collections.singleton(agentType)));
          if (StringUtils.isEmpty(serverURL)) {
              create(callerToken, realm, agentName, agentType, attributes);
          } else {
              create(callerToken, realm, agentName, agentType, attributes, serverURL, agentURL);
          }
      } else {
          create(callerToken, realm, agentName, agentType, attributes);
      }
      ...

        Attachments

          Activity

            People

            rebecca.hayling Rebecca Hayling [X] (Inactive)
            rebecca.hayling Rebecca Hayling [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: