简体   繁体   中英

Grails Spring Security Core Plugin :authentication not required for controller

I have

  • Grails 2.0.4
  • spring-security-core:1.2.7.3

i want to expose some controller as web service. (this methods will be called from php application out side the domain)

Example controller :

 def getAnimalJson(){
    def animalList  = Animal.list()
    render "${params.callback}(${animalList as JSON})"
}

if i logged in grails application, method call is successful from php application but when logged out it fails.

i want to this controller not be checked by spring securitycore..

thanks for helping ..

Without an annotation it should be allowed. Did you annotate at the controller level? Or are you using requestmaps or the Config.groovy map? If you're using annotations you can add this to that method

@Secured('permitAll')

and it won't be guarded. Do the same thing with a requestmap or in Config.groovy if you're using a different approach.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM