Grails remote control plugin - Spring Security Configuration

425 views Asked by At

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)

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.

How do I configure the spring security core to permitAll for the grails-remote-control url?

2

There are 2 answers

0
Anant Kolvankar On BEST ANSWER

Put Below code in your config.groovy

grails.plugin.springsecurity.securityConfigType = 'InterceptUrlMap'

grails.plugin.springsecurity.interceptUrlMap = [
        '/grails-remote-control/**':       ['IS_AUTHENTICATED_ANONYMOUSLY']
]
0
Matthias Hamann On

If you are using spring security 2 with staticRules + controllerAnnotations, it also works:

grails.plugin.springsecurity.controllerAnnotations.staticRules = [
        '/grails-remote-control/**': ["permitAll"]
]