Search code examples
springgrailsspring-security

Disable Spring Security /login/auth and define everything explicitly?


I'm trying to setup a new project using Spring Security. When you do so every page is auto redirected to /login/auth. I read that you can disable this and instead explicitly state all controllers/routes. can someone point me in the right direction as far as how to obtain this? been searching forever and cant find it.

I first read about it in answer one of this question :

Grails, Spring Security Core - remove /login/auth from application


Solution

  • Reading the section Pessimistic Lockdown in the documentation will lead you to the fact you can reverse this behavior by using the following configuration:

    // Config.groovy 
    grails.plugin.springsecurity.rejectIfNoRule = false
    grails.plugin.springsecurity.fii.rejectPublicInvocations = true
    

    This should accomplish what you are after. I recommend reading the documentation for this plugin as it is well written and covers a lot of useful information.