Configure OpenIG to re-direct to specific URL if condition matches

This topic has 1 reply, 2 voices, and was last updated 1 month, 3 weeks ago by violette.

  • Author
    Posts
  • #26972
     kjreddy211
    Participant

    Hi Team,

    I have a requirement to configure OpenIG to redirect to a specific URL when the request.uri.host = openam.example.com
    Please help me to get json file for this requirement.

    Thanks,
    Mani Deep.

    #27567
     violette
    Participant

    Hi there,
    I think you have found the solution alone given the time but here a short sample on how to make a redirect with IG:

    
    {
      "handler": {
        "type": "Chain",
        "config": {
          "filters": [{
            "type": "HeaderFilter",
            "config": {
              "messageType": "RESPONSE",
              "add": {
                "Location": ["http://www.forgerock.com"]
              }
            }
          }],
          "handler": {
            "type": "StaticResponseHandler",
            "config": {
              "status": 302
            }
          }
        }
      },
      "condition": "${matches(request.uri.host, 'openam.example.com')}"
    }
    
    

    In this case, if the condition is met, meaning that if your URI host is openam.example.com, you will be redirected to the address specified in the Location header.
    See https://backstage.forgerock.com/docs/ig/6.5/reference/#HeaderFilter

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

You must be logged in to reply to this topic.

©2020 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?