Grails远程控制插件-Spring Security Configuration [英] Grails remote control plugin - Spring Security Configuration
问题描述
每当我尝试使用Grails远程控制插件时,都会出现以下异常.
Whenever I try to use the Grails Remote Control plugin, I get the following Exception.
groovyx.remote.RemoteControlException: Error sending command chain to 'http://localhost:8080/******/grails-remote-control'
[test] at groovyx.remote.transport.http.HttpTransport.send(HttpTransport.groovy:65)
[test] at groovyx.remote.client.RemoteControl.sendCommandChain(RemoteControl.groovy:114)
[test] at groovyx.remote.client.RemoteControl.exec(RemoteControl.groovy:73)
[test] at groovyx.remote.client.RemoteControl.exec(RemoteControl.groovy:67)
[test] at cgw.login.AbstractCGWGebSpec.msg(AbstractCGWGebSpec.groovy:35)
[test] at cgw.login.AbstractCGWGebSpec.Login to cgw application(AbstractCGWGebSpec.groovy:25)
[test] Caused by: java.io.StreamCorruptedException: invalid stream header: 3C68746D
[test] at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:782)
[test] at java.io.ObjectInputStream.(ObjectInputStream.java:279)
[test] at groovyx.remote.util.ClassLoaderConfigurableObjectInputStream.(ClassLoaderConfigurableObjectInputStream.groovy:26)
[test] at groovyx.remote.Result.readFrom(Result.groovy:150)
[test] at groovyx.remote.transport.http.HttpTransport.send_closure1(HttpTransport.groovy:62)
[test] at groovyx.remote.transport.http.HttpTransport.send(HttpTransport.groovy:53)
一个简单的Google搜索显示它很可能是由于与Spring Security插件发生冲突.您可以在此处看到它.不幸的是,在不深入了解Spring Security插件文档的情况下,我找不到有关如何正确配置它的任何信息.
A simple Google search reveals that it is most likely due to a conflict with the Spring Security plugin. You can see it here. Unfortunately, I cannot find any information on how to properly configure it without going deep into the Spring Security plugin documentation.
如何配置grails-remote-control url的spring安全核心以allowAll?
How do I configure the spring security core to permitAll for the grails-remote-control url?
推荐答案
将以下代码放入config.groovy中
Put Below code in your config.groovy
grails.plugin.springsecurity.securityConfigType = 'InterceptUrlMap'
grails.plugin.springsecurity.interceptUrlMap = [
'/grails-remote-control/**': ['IS_AUTHENTICATED_ANONYMOUSLY']
]
这篇关于Grails远程控制插件-Spring Security Configuration的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!