I'm following the tutorials to use springsecurity authentication plugin. I am using grails version 2.3.8 and spring-security-core:2.0-RC2. It worked as expected to create the HelloWorld controller with the Secured annotation:
package basicauthdemo
import grails.plugin.springsecurity.annotation.Secured
class HelloController {
@Secured(['ROLE_USER'])
def index() {
render "Hello World"
}
}
and then be presented with a login screen.
My question is that when I created another controller without the @Secured annotation. I still get the login screen when navigating to that controller. Spring security is now in charge of all access to my controllers as I can see from the filter-mapping in the generated web.xml:
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>ERROR</dispatcher>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
How to tell the plugin to allow open access to some controllers and not others? I thought that this would be determined by presence of @Secured annotation but that only defines the role with permissions for the controller.