Shay Tsadok
Shay Tsadok

Reputation: 933

extend spring security filter chain

I've registered my spring security xml file in the web.xml.

Now I have a different jar that would like to extend spring security and add his own filter chain. This jar cannot extend the web.xml of course.

How do you recommend to do that?

Thanks in advance, Shay

Upvotes: 1

Views: 1530

Answers (1)

ptomli
ptomli

Reputation: 11818

If your other jar is also using Spring then you should be able to inject the FilterChainProxy that Spring Security uses into something in your other jar. It all depends on how your jars are assembled into an application (context).

See the Spring Security reference and Javadoc for FilterChainProxy

FilterChainProxy provides getFilterChainMap and setFilterChainMap. It would seem possible to manipulate the chain through these methods, but I can't confirm this having not tried it myself.

Upvotes: 2

Related Questions