OpenIG : Retrieving Query Parameters From request URI and Pass it Handler

This topic contains 2 replies, has 2 voices, and was last updated by  Avneesh991 2 months, 1 week ago.

  • Author
    Posts
  • #25926
     Avneesh991 
    Participant

    Hello All,
    I’ve a requirement to retrieve the query parameter from the request URI. This query parameter basically contains an another URL. We want to redirect user to that URL.
    I’ve tried to use entity extract filter but that doesn’t seem to work to retrieve the param.

    Any pointer will be highly appreciated.

    Thanks,
    Avnish

    #25934
     violette 
    Participant

    Hi Avnish,
    You could simply use a HeaderFiler such as:

    {
      "handler": {
        "type": "Chain",
        "config": {
          "filters": [{
            "type": "HeaderFilter",
            "config": {
              "messageType": "RESPONSE",
              "add": {
                "Location": ["${request.form['uri'][0]}"]
              }
            }
          }],
          "handler": {
            "type": "StaticResponseHandler",
            "config": {
              "status": 302
            }
          }
        }
      },
      "condition": "${matches(request.uri.path, '^/redirect')}"
    }

    Note the ${request.form['uri'][0]} where ‘uri’ is your request parameter.
    You can found the documentation at https://backstage.forgerock.com/docs/ig/6.5/reference/#HeaderFilter

    #25939
     Avneesh991 
    Participant

    Thanks for your prompt reply, Violette. This is precisely I was looking for. Earlier I was trying request.uri.query which was giving me all the query params present in the URL.

    -Avnish

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

©2019 ForgeRock - we provide an identity and access platform to secure every online relationship for the enterprise market, educational sector and even entire countries. Click to view our privacy policy and terms of use.

Log in with your credentials

Forgot your details?