Uploaded image for project: 'Identity Gateway'
  1. Identity Gateway
  2. OPENIG-1664

Provide support for basic URI path rewriting



    • Story
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.0.0, 3.1.0, 3.1.1, 4.0.0, 4.5.0
    • 7.0.0
    • Core
    • OpenIG Sprint 100, OpenIG Sprint 101, 2019.15 - IG / Microservices, 2019.16 - IG / Microservices, 2019.17 - IG / Microservices
    • 5


      As an administrator I would like IG to support basic path rewriting in order to allow applications behind IG to be exposed with a different path.


      This covers the use-case where the request URI path should be rewritten before sending the request to the proxied application.

      This can be a complex problem to solve when looking at being able to change any aspect of the URIs path so this improvement only covers the simple case of changing the initial part of the URIs path, analogous to the context of a Java web application.

      For example, changing the path /frompath to the path /topath

      Request hits OpenIG as http://openig/frompath/test
      Request from OpenIG to proxied application would become http://app/topath/test

      The proxied application may issue a location header in the response and this is likely to contain the /topath in its URI so additional processing maybe required to rewrite the URI before returning the response.

      Acceptance Criteria

      • Add UriRewritingFilter that would contains a list of mapping rules
      • Location, Content-Location and URI response headers are to be rewritten
      • Need to support just a basic path prefix mapping (can cover multiple path elements)
        Such as:
        • / is transformed to /wordpress on the request flow, the reverse transformation applied to selected response headers
        • /openam is transformed to /am or just /
      • Response transformation need to be done only for Ig's host:port (not transforming redirects to anotherapp.acme.com)
      • Protoype configuration as a decorator


       "mappings": {
        "/fromPath1": "/toPath1",
        "/fromPath2": "/toPath2" 

      Summary of corresponding Zendesk tickets: https://docs.google.com/document/d/1stFSN-AAon4Uv7VQpTjn2kkW2OtkniGCaDZKD7hoBBY/edit#


          Issue Links



              wayne.morrison Wayne Morrison
              markdr Mark de Reeper
              2 Vote for this issue
              13 Start watching this issue