1
Good morning, I am developing a Grails application and decided to implement authorization and authentication the same is working perfectly however I decided to change the login form to my form and not the standard of Spring Security Core however I am having the following error when trying to access the URL in Google Chrome, "ERRO_TO_MANY_REDIRECTS", the line I changed in my Config.groovy was:
// Added by the Spring Security Core plugin:
grails.plugin.springsecurity.userLookup.userDomainClassName = 'org.lab2.security.User'
grails.plugin.springsecurity.userLookup.authorityJoinClassName = 'org.lab2.security.UserRole'
grails.plugin.springsecurity.authority.className = 'org.lab2.security.Role'
// Aqui entra as alterações feitas por mim
grails.plugin.springsecurity.auth.loginFormUrl = '/areaRestrita/login' //Mostra qual a tela de login
rails.plugin.springsecurity.auth.afterLogoutUrl = '/areaRestrita/logout' //Mostra qual a tela de logout
grails.plugin.springsecurity.successHandler.defaultTargetUrl = '/contato/index' //Mostra qual URL chamada caso o login funcione
// Aqui termina minhas alterações
grails.plugin.springsecurity.controllerAnnotations.staticRules = [
'/': ['permitAll'],
'/index': ['permitAll'],
'/index.gsp': ['permitAll'],
'/assets/**': ['permitAll'],
'/**/js/**': ['permitAll'],
'/**/css/**': ['permitAll'],
'/**/images/**': ['permitAll'],
'/**/favicon.ico': ['permitAll']
]
Being that the lines in bold were the ones added by me to determine the login and logout form, along with the initial page when logging in. If anyone has a solution I’ll be grateful for your help.
Perfect guy, worked the page dr login was displayed however not logging in.
– 1fabiopereira
I suggest marking this answer as correct then and creating a new question regarding the login page, displaying its source code and further detailing the problem.
– Ricardo Silva
Modifying the login form for Spring Security Core and Groovy Grails - http://answall.com/q/63755/22504
– 1fabiopereira
Take a look at this case Maybe you can help me
– 1fabiopereira
I saw the problem you posted regarding the view, however, as I still have no reputation in pt.stackoverflow I can not comment there. You can also post the code of the controller that is receiving the request?
– Ricardo Silva
I did not post the controller code here due to the fact that this controller is generated by grails scaffolding dynamically this is the responsibility of Spring Security Core, however already found the solution was Tomcat error. Anything give a look there in the comment of the question.
– 1fabiopereira