Acegi config for annotations

classic Classic list List threaded Threaded
2 messages Options
Fyv
Reply | Threaded
Open this post in threaded view
|

Acegi config for annotations

Fyv
Hi.
First of all, sorry for my poor English, i'm not used to speaking

I am currently developing a Grails app, and i installed ACEGI plugin using this tutorial : http://grails.org/AcegiSecurity+Plugin+-+Basic+Tutorial+with+Annotations

But, when i change the SecurityConfig.groovy, my app no longer works.

My code :

security {

        // see DefaultSecurityConfig.groovy for all settable/overridable properties

        active = true

        loginUserDomainClass = "com.oor.Osteo"
        authorityDomainClass = "com.oor.Role"

        useRequestMapDomainClass = false

        useControllerAnnotations = true
}

My application.properties :

#Grails Metadata file
#Wed Jul 11 20:22:28 CEST 2012
app.grails.version=2.1.0
app.name=OsteosOnRails
app.version=0.1
plugins.acegi=0.5.3.2
plugins.fields=1.2
plugins.twitter-bootstrap=2.0.1.22

And the error message i get :

java.lang.IllegalStateException
Message
No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.

Thanks for help.
Reply | Threaded
Open this post in threaded view
|

Re: Acegi config for annotations

Burt Beckwith
Administrator
The Acegi plugin isn't supported any more - use the http://grails.org/plugin/spring-security-core plugin instead. As long as you are using the latest version you won't see this problem.

Also - you shouldn't be using install-plugin - there shouldn't be any plugin entries in application.properties. Add dependencies in the plugins section of your BuildConfig.groovy:

   plugins {
      ...
      compile ":spring-security-core:1.2.7.3"
      compile ":fields:1.2"
      compile ":twitter-bootstrap:2.0.2.25"
   }

Burt

Fyv wrote
Hi.
First of all, sorry for my poor English, i'm not used to speaking

I am currently developing a Grails app, and i installed ACEGI plugin using this tutorial : http://grails.org/AcegiSecurity+Plugin+-+Basic+Tutorial+with+Annotations

But, when i change the SecurityConfig.groovy, my app no longer works.

My code :

security {

        // see DefaultSecurityConfig.groovy for all settable/overridable properties

        active = true

        loginUserDomainClass = "com.oor.Osteo"
        authorityDomainClass = "com.oor.Role"

        useRequestMapDomainClass = false

        useControllerAnnotations = true
}

My application.properties :

#Grails Metadata file
#Wed Jul 11 20:22:28 CEST 2012
app.grails.version=2.1.0
app.name=OsteosOnRails
app.version=0.1
plugins.acegi=0.5.3.2
plugins.fields=1.2
plugins.twitter-bootstrap=2.0.1.22

And the error message i get :

java.lang.IllegalStateException
Message
No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.

Thanks for help.