This topic has 2 replies, 2 voices, and was last updated 6 years, 9 months ago by Mark Craig.
-
AuthorPosts
-
November 5, 2015 at 6:41 pm #6197
[email protected]
ParticipantDoes anyone have an example config.json showing how to use LocationHeaderFilter? I’m new to OpenAM/OpenIG, and trying to follow the examples in the getting started guides. My protected application is running at http://qa-sso-px01.dc1.lan:8080/, and OpenIG 3.1.0 is on the same box at port 80. I want to rewrite 302 redirects returned by the application to replace the “real” port of 8080 with 80. I tried variations on the following config.json, but couldn’t make it work:
{ "handler": { "type": "Router", "audit": "global", "capture": "all" }, "heap": [ { "name": "LogSink", "type": "ConsoleLogSink", "config": { "level": "DEBUG" } }, { "name": "JwtSession", "type": "JwtSession" }, { "name": "ClientHandler", "type": "ClientHandler" }, { "name": "capture", "type": "CaptureDecorator", "config": { "captureEntity": true, "_captureExchange": true } }, { "name": "LocationRewriter", "type": "LocationHeaderFilter", "config": { "baseURI": "http://qa-sso-px01.dc1.lan:80/" } } ], "baseURI": "http://qa-sso-px01.dc1.lan:8080" }
-
This topic was modified 6 years, 9 months ago by
[email protected].
November 5, 2015 at 7:46 pm #6199[email protected]
ParticipantTo answer my own question I had better luck by putting the filter into a route instead, e.g. in 98-rewrite.json like so:
{ "handler": { "type": "Chain", "comment": "Rewrite redirect responses to use the OpenIG baseURI", "config": { "filters": [ { "name": "LocationRewriter", "type": "LocationHeaderFilter", "config": { "baseURI": "http://qa-sso-px01.dc1.lan:80" } } ], "handler": "ClientHandler" } } }
November 6, 2015 at 7:26 am #6209Mark Craig
ParticipantYes, as you found out, almost all the objects defined in the heap need to be used somewhere to take effect.
The reason the “LogSink” defined in the heap has an effect is because it is one of a couple of automatically created objects that OpenIG sets up whether you do anything or not, and whose configurations can be overridden if you declare a configuration having the same name. The other object is “TemporaryStorage”. (For details, see the heap objects reference documentation.)
-
This topic was modified 6 years, 9 months ago by
-
AuthorPosts
You must be logged in to reply to this topic.