问题
Grails spring security fails to present the login page due to a redirect loop
Where I must write this?
new Requestmap(url: '/*', configAttribute: 'IS_AUTHENTICATED_ANONYMOUSLY').save();
回答1:
Information obtained from Dynamic Request Maps section on Spring.io's blog post titled "Simplified Spring Security with Grails".
To enable this mechanism, add the following to Config.groovy:
import grails.plugins.springsecurity.SecurityConfigType ... grails.plugins.springsecurity.securityConfigType = SecurityConfigType.Requestmap
All you then have to do is create instances of the
Requestmap
domain class, for example inBootStrap.groovy
:new Requestmap(url: '/timeline', configAttribute: 'ROLE_USER').save() new Requestmap(url: '/person/*', configAttribute: 'IS_AUTHENTICATED_REMEMBERED').save() new Requestmap(url: '/post/followAjax', configAttribute: 'ROLE_USER').save() new Requestmap(url: '/post/addPostAjax', configAttribute: 'ROLE_USER,IS_AUTHENTICATED_FULLY').save() new Requestmap(url: '/**', configAttribute: 'IS_AUTHENTICATED_ANONYMOUSLY').save()
来源:https://stackoverflow.com/questions/25428412/how-used-grails-spring-security-plugin-requestmap