Hello Mark, I know it's probably way to late for a reply, but I came across a similar issue. It looks like you have almost everything good to go, the only thing you're missing is declaring your custom servlet in the META-INF/spring.factories file, like below:
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ com.example.CustomConfig1,\ com.example.CustomConfig2,\ uk.ac.bris.adt.StripRenewFilter Regards, Julio On Friday, May 21, 2021 at 1:08:48 PM UTC-4 Mark van Rossum wrote: > Hi, > > Following on from my previous message > <https://groups.google.com/a/apereo.org/g/cas-user/c/4vknnIb3_hA/m/Tf89DkJlBAAJ> > about > CAS throwing an NPE when a service specifies renew=true, I'm trying to > write a Servlet Filter to remove this parameter from an incoming request > before it gets to CAS. > > I've written a filter and put it in > "src/main/java/..../StripRenewFilter.java", then tried adding the filter to > the web.xml > <https://github.com/apereo/cas-overlay-template/blob/master/src/main/webapp/WEB-INF/web.xml>file > > as: > <filter> > <filter-name>StripRenewFilter</filter-name> > <filter-class>uk.ac.bris.adt.StripRenewFilter</filter-class> > </filter> > > <filter-mapping> > <filter-name>StripRenewFilter</filter-name> > <url-pattern>/*</url-pattern> > </filter-mapping> > > But it doesn't take effect. I've also tried annotating the filter with > @WebFilter which equally had no effect. > > I'm running CAS locally using "gradlew run" > > How can I load a filter into a CAS server to achieve this? > > Thank you! > Mark van Rossum > > -- - Website: https://apereo.github.io/cas - Gitter Chatroom: https://gitter.im/apereo/cas - List Guidelines: https://goo.gl/1VRrw7 - Contributions: https://goo.gl/mh7qDG --- You received this message because you are subscribed to the Google Groups "CAS Community" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/92617f38-836b-4685-9f80-08e1281bf7bfn%40apereo.org.
