How to configure a pre-authentication url rewrite filter in Spring 5?

We have a working Spring 4 web application with multiple tenants that has a Tuckey UrlRewriter filter at the beginning of the filter chain (before authentication, session management, etc.).

Our urls look like this: http://example.com/mytenant/content

This is rewritten:http://example.com/content?_s=mytenant

So far, all filters (authentication, session) have been run for both rewritten and unrewritten urls (since in Spring 4 all filters have been configured for both the default DispatcherType.REQUEST

and DispatcherType.FORWARD

the default)

Now we are trying to run Spring 5 and now (following the servlet spec) filters are not triggered after a rewrite event.

I assume that reconfiguring all filters for DispatcherType.FORWARD

would be a solution too, but it seems ugly (I think there is a good reason for the new defaults), so I'm still looking for a better solution. What would be the recommended Spring 5 for this? (I may be using the UrlRewrite filter incorrectly)

Thanks for any advice!

+3


source to share





All Articles