What is the equivalent of addFilter annotation in xml?



I am working with Spring security oAuth. I have a xml based configuration. I want to adapt the configuration made in this github code . But i don't know how to write the following expression in xml (lines 58 and 61):



addFilterBefore(new StatelessLoginFilter("/api/login", tokenAuthenticationService, userDetailsService, authenticationManager()), UsernamePasswordAuthenticationFilter.class)


And



.addFilterBefore(new StatelessAuthenticationFilter(tokenAuthenticationService), UsernamePasswordAuthenticationFilter.class);


Here the snippet i write in my web.xml :



<filter>
<filter-name>statelessLoginFilter</filter-name>
<filter-class>com.web.filters.StatelessLoginFilter</filter-class>
<init-param>
<param-name></param-name>
<param-value></param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>statelessLoginFilter</filter-name>
<url-pattern>/api/login</url-pattern>

</filter-mapping>


I don't know how to write add Filter before and inject the service. Thanks


No comments:

Post a Comment