IG to default to a specified path

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

  • Author
    Posts
  • #25171
     sreekanthrvs 
    Participant

    When a client request comes into IG for https://www.abc.com, the requirement is to send the request to https://www.xyz.com/portal. Can this kind of redirection can be done using IG? We tried the below, but IG is neglecting the path part in the baseURI.

    Below is our current configuration snippet:
    “baseURI” : “https://www.xyz.com/portal”,
    “condition” : “${matches(request.uri.host, ‘^www.abc.com’) && matches(request.uri.path, ‘^/’)}”

    Any suggestions?

    Thanks
    Yuva

    #25286
     Dusty 
    Participant

    Hi Yuva,

    IG doesn’t support URL rewriting. It only supports rebasing for the domain. If you want a real redirect you could use a StaticResponseHandler

    
    {
              "condition": "${empty session.username}",
              "handler": {
                "type": "StaticResponseHandler",
                "config": {
                  "status": 302,
                  "reason": "Found",
                  "headers": {
                    "Location": [
                      "http://sp.example.com:8080/saml/SPInitiatedSSO"
                    ]
                  }
                }
              }
            }
    

    If you want a real url rewrite, you should use a script with the ScriptableFilter.

    https://backstage.forgerock.com/docs/ig/6.5/gateway-guide/#about-scripting

    Regards
    Dusty

Viewing 2 posts - 1 through 2 (of 2 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?