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

CustomProperties do not work when creating J2EE/Web Agents via REST

    Details

    • Sprint:
      AM Sustaining Sprint 49, AM Sustaining Sprint 50, AM Sustaining Sprint 51, AM Sustaining Sprint 52
    • Story Points:
      3
    • Needs backport:
      Yes
    • Support Ticket IDs:
    • Verified Version/s:
    • Needs QA verification:
      Yes

      Description

      I have a test case which uses jq utility ( https://stedolan.github.io/jq/ )

      where the customProperties is "mytest=value" and"com.forgerock.net=test"

      #!/bin/sh
       #set -vx
      openam="http://openam.internal.example.com:8080"
       user="amadmin"
       password="password"
      
       tokenid=`curl -s --request POST --header "X-OpenAM-Username: $user" --header "X-OpenAM-Password: $password" --header "Content-Type: application/json" --data "{}" "$openam/openam/json/authenticate" | jq -r .tokenId`
       echo "tokenid is " $tokenid
      
      curl -s --request PUT --header "iPlanetDirectoryPro: $tokenid " --header "Content-Type: application/json" --data '
      {"userpassword":"password","status":"Active","customProperties":["mytest=value","com.forgerock.net=test"] , "repositoryLocation":"centralized","agentConfigChangeNotificationsEnabled":true,"notificationsEnabled":true,"agentNotificationUrl":"http://eave.internal.example.com:8000/UpdateAgentCacheServlet?shortcircuit=false","agentUriPrefix":"http://eave.internal.example.com:8000/amagent","configurationPollingInterval":60,"configurationCleanupInterval":30,"cdssoRootUrl":["http://eave.internal.example.com:8000/"],"ssoOnlyMode":false,"agentDebugLevel":"Error","debugLogRotation":true,"debugRotationSize":10000000,"auditAccessType":"LOG_NONE","auditLogLocation":"REMOTE","remoteLogSendInterval":5,"localAuditLogRotation":false,"localAuditRotationSize":52428800,"fqdnCheck":false,"fqdnDefault":"","ignorePathInfo":false,"invertNotEnforcedUrls":false,"fetchAttributesForNotEnforcedUrls":false,"clientIpValidation":false,"profileAttributeFetchMode":"NONE","responseAttributeFetchMode":"NONE","sessionAttributeFetchMode":"NONE","attributeMultiValueSeparator":"|","cookieName":"iPlanetDirectoryPro","secureCookies":false,"cdssoRedirectUri":"agent/cdsso-oauth2","cdsso":false,"cookieResetEnabled":false,"agentConnectionTimeout":2,"primaryServerPollingPeriod":5,"policyCachePollingInterval":3,"ssoCachePollingInterval":3,"userIdParameter":"UserToken","userIdParameterType":"session","fetchPoliciesFromRootResource":false,"retrieveClientHostname":false,"policyClockSkew":0,"policyEvaluationRealm":"/","policyEvaluationApplication":"iPlanetAMWebAgentService","agentLocale":"en_US","anonymousUserEnabled":false,"encodeSpecialCharsInCookies":false,"profileAttributesCookiePrefix":"HTTP_","profileAttributesCookieMaxAge":300,"caseInsensitiveUrlComparison":true,"encodeUrlSpecialCharacters":false,"ignorePreferredNamingUrl":true,"ignoreServerCheck":false,"ignorePathInfoForNotEnforcedUrls":true,"encodeProfileAttributes":false,"gotoParameterName":"goto","anonymousUserId":"anonymous","loadBalanced":false,"overrideRequestProtocol":false,"overrideRequestHost":false,"overrideRequestPort":false,"overrideNotificationUrl":false,"postDataPreservation":false,"postDataCachePeriod":10,"filterPriority":"HIGH","filterConfiguredWithOwa":false,"changeProtocolToHttps":false,"showPasswordInHeader":false,"logonAndImpersonation":false,"checkUserInDomino":false,"useLtpaToken":false,"ltpaTokenCookieName":"LtpaToken","ltpaTokenConfigurationname":"LtpaToken"}
      ' $openam/openam/json/realms/root/realm-config/agents/WebAgent/webagent
      
      curl -s -X GET --header 'Accept: application/json' --header "iPlanetDirectoryPro: $tokenid " $openam/openam/json/realm-config/agents/WebAgent?_queryFilter=true | jq .
      

      Running the script first time, you will observed that

      and the first PUT API output is always wrong

       },
            "ignorePathInfoForNotEnforcedUrls": true,
            "remoteLogSendInterval": 5,
            "changeProtocolToHttps": false,
            "responseAttributeFetchMode": "NONE",
            "userpassword": null,
            "customProperties": [
              "AgentType=WebAgent"     <======================
            ],
      

       Running the above script again. Resolve the issue.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                yaodong.hu Yaodong Hu [X] (Inactive)
                Reporter:
                sam.phua Sam Phua
              • Votes:
                0 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: