I'm trying to do this in my groovy class which is in src
directory of my grails application.
Its an Filter
. The class looks like this :
class Proxy implements Filter {
}
Inside the init
method I'm getting the springSecurityService
bean using :
GrailsApplication application = org.codehaus.groovy.grails.commons.ApplicationHolder.getApplication()
springSecurityService = application.getMainContext().getBean("springSecurityService")
And inside my doFilter
I'm trying to find whether the user is been authenticated or not. I tried:
springSecurityService.isLoggedIn()
but its always returning false
.
Where I'm making the mistake?
Thanks in advance.