Uploaded image for project: 'OpenAM Agents'
  1. OpenAM Agents
  2. AMAGENTS-674

org.forgerock.agents.config.json.response.code does not work for C Agents 5

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.0.0
    • Fix Version/s: 5.0.0.0
    • Component/s: Web Agents
    • Environment:
      Ubuntu 14.04 / Apache 2.4

      Description

      org.forgerock.agents.config.json.response.code does not work for C Agents 5. This issue is regression (works for 4.1.0)

       

      Steps to Reproduce

      1.) Configure agent profile
      Advanced tab > Custom Properties

      • org.forgerock.agents.config.json.header[testJson]=test
      • org.forgerock.agents.config.json.response.code=202

      2.) Create a request to agent with header testJson=test.

      curl -v -X GET -H "testJson: test" http://riso-ubuntu14.test.forgerock.com:80/index.html
      

      Observed Result

      If I hit the agent page with configured header(config.json.header), agent does NOT returns expected status code configured in config.json.response.code property

      curl -v -X GET -H "testJson: test" http://riso-ubuntu14.test.forgerock.com:80/index.html
      Note: Unnecessary use of -X or --request, GET is already inferred.
      *   Trying 10.1.4.67...
      * Connected to riso-ubuntu14.test.forgerock.com (10.1.4.67) port 80 (#0)
      > GET /index.html HTTP/1.1
      > Host: riso-ubuntu14.test.forgerock.com
      > User-Agent: curl/7.47.0
      > Accept: */*
      > testJson: test
      > 
      < HTTP/1.1 302 Found
      < Date: Wed, 21 Jun 2017 14:35:24 GMT
      < Server: Apache/2.4.12 (Unix) OpenSSL/1.0.1f OpenAM Web Agent/5.0.0-SNAPSHOT
      < Set-Cookie: iPlanetDirectoryPro=;Max-Age=0;Expires=Thu, 01-Jan-1970 00:00:01 GMT;Path=/
      < Location: http://perf-openam.internal.forgerock.com:8080/openam/oauth2/authorize?response_type=id_token&scope=openid&client_id=apache24&realm=%2F&redirect_uri=http%3A%2F%2Friso-ubuntu14.test.forgerock.com%3A80%2Fagent%2Fcdsso-oauth2&state=2296d04d-7bda-ae4a-8e21-4251697d3c71&nonce=bfaabb702c41e3f7122aa17ad9fff54f&response_mode=form_post&agent_provider=true
      < Content-Length: 564
      < Content-Type: text/html; charset=iso-8859-1
      < 
      <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
      <html><head>
      <title>302 Found</title>
      </head><body>
      <h1>Found</h1>
      <p>The document has moved <a href="http://perf-openam.internal.forgerock.com:8080/openam/oauth2/authorize?response_type=id_token&amp;scope=openid&amp;client_id=apache24&amp;realm=%2F&amp;redirect_uri=http%3A%2F%2Friso-ubuntu14.test.forgerock.com%3A80%2Fagent%2Fcdsso-oauth2&amp;state=2296d04d-7bda-ae4a-8e21-4251697d3c71&amp;nonce=bfaabb702c41e3f7122aa17ad9fff54f&amp;response_mode=form_post&amp;agent_provider=true">here</a>.</p>
      </body></html>
      * Connection #0 to host riso-ubuntu14.test.forgerock.com left intact
      

      Expected Result

      Agent returns configured status code(202), because request contains the header set in config.json.header property

      iso@profiq-nb-riso:~$ curl -v -X GET -H "testJson: test" http://perf-openam2.internal.forgerock.com:80/index.html
      Note: Unnecessary use of -X or --request, GET is already inferred.
      *   Trying 172.24.3.66...
      * Connected to perf-openam2.internal.forgerock.com (172.24.3.66) port 80 (#0)
      > GET /index.html HTTP/1.1
      > Host: perf-openam2.internal.forgerock.com
      > User-Agent: curl/7.47.0
      > Accept: */*
      > testJson: test
      > 
      < HTTP/1.1 202 Accepted
      < Date: Wed, 21 Jun 2017 14:30:21 GMT
      < Server: Apache/2.4.9 (Unix) OpenAM Web Agent/4.1.0
      < Transfer-Encoding: chunked
      < Content-Type: application/json
      < 
      * Connection #0 to host perf-openam2.internal.forgerock.com left intact
      {"error": { "errors": [  {   "message": "redirect",   "location": "http://perf-openam.internal.forgerock.com:8080/openam/UI/Login?goto=http%3A%2F%2Fperf-openam2.internal.forgerock.com%3A80%2Findex.html"  } ], "code": 302 }}
      

      It is also possible to reproduce this case with property org.forgerock.agents.config.json.url[]. If you hit the configured URL, you will get configured status code.

        Attachments

          Activity

            People

            Assignee:
            rich.riley Rich Riley [X] (Inactive)
            Reporter:
            richard.hruza Richard Hruza
            QA Assignee:
            Richard Hruza Richard Hruza
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: