【发布时间】:2014-10-15 05:01:49
【问题描述】:
Grails spring security fails to present the login page due to a redirect loop
我必须在哪里写这个?
new Requestmap(url: '/*', configAttribute: 'IS_AUTHENTICATED_ANONYMOUSLY').save();
【问题讨论】:
标签: grails-2.3
Grails spring security fails to present the login page due to a redirect loop
我必须在哪里写这个?
new Requestmap(url: '/*', configAttribute: 'IS_AUTHENTICATED_ANONYMOUSLY').save();
【问题讨论】:
标签: grails-2.3
信息来自 Spring.io 博客文章“Simplified Spring Security with Grails”的Dynamic Request Maps 部分。
要启用此机制,请将以下内容添加到 Config.groovy:
import grails.plugins.springsecurity.SecurityConfigType ... grails.plugins.springsecurity.securityConfigType = SecurityConfigType.Requestmap然后您所要做的就是创建
Requestmap域的实例 类,例如BootStrap.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()
【讨论】:
.groovy 文件中。BootStrap.groovy 只是一个示例。