How to override class in grails

时间:2015-06-26 10:08:25

标签: grails spring-security

I am using Spring security rest plugin to authenticate the user. In this, there is a class named RestAuthenticationFilter. Now I want to call the methods of some custom class say CustomRestAuthenticationFilter (which extends RestAuthenticationFilter) instead of RestAuthenticationFilter. How to do this?

Is there any way that we define in resources.groovy or somewhere else that to use CustomRestAuthenticationFilter instead of RestAuthenticationFilter ?

1 个答案:

答案 0 :(得分:0)

我相信在文档中很好地描述了过滤!

https://grails-plugins.github.io/grails-spring-security-core/guide/filters.html

只需修改grails.plugin.springsecurity.filterChain.filterNames文件中的Config.groovy值,使其包含RestAuthenticationFilter代替RestAuthenticationFilter,您就应该好了。