Sunday, November 21, 2010

Grails Acegi plugin and Spring Security Core Plugin

As you might have suspected it: I am writing again on technical subject simply because I want to save some hours for you folks out there in the wild.

Yup, I was trying to read the instructions found here in Grails.org for using Acegi plugin.

If you are in a rush, then just read this line: The above tutorial is very outdated and you should probably not waste your life following it anymore.

OK, here is what I did (removed some path information to protect some privacy) :

# grails install-plugin acegi
Welcome to Grails 1.3.5 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: \tools\grails-1.3.5

Base Directory: test3
Resolving dependencies...
Dependencies resolved in 1094ms.
Running script \tools\grails-1.3.5\scripts\InstallPlugin.groovy
Environment set to development
Resolving plugin acegi. Please wait...

:: problems summary ::
:::: WARNINGS
                [NOT FOUND  ] org.grails.plugins#acegi;0.6!acegi.zip (219ms)

        ==== grailsCentral: tried

          http://svn.codehaus.org/grails-plugins/grails-acegi/tags/RELEASE_0_6/g
rails-acegi-0.6.zip

                ::::::::::::::::::::::::::::::::::::::::::::::

                ::              FAILED DOWNLOADS            ::

                :: ^ see resolution messages for details  ^ ::

                ::::::::::::::::::::::::::::::::::::::::::::::

                :: org.grails.plugins#acegi;0.6!acegi.zip

                ::::::::::::::::::::::::::::::::::::::::::::::


Error resolving plugin [name:acegi, group:org.grails.plugins, version:latest.int
egration].
Plugin not found for name [acegi] and version [not specified]

As you can see, I cannot download the plugin. Heh, no problem especially after you have read this article and have some inspiration? We download the latest version from codehause (at this point of writing, I can find the best candidate to be here).

Guess what? Installation was great. But when you try to create-auth-domains, there are no domain classes created. It is all empty!

OK, now the right way. The right way is to move to Spring Security Core Plugin! The reference document can be found here and for those who just want to jump into it, please go straight to here.

I really wished that the article/blogs/whatever authors of acegi would just help the village to update their materials and point to Spring Security Core Plugin as it is already stated in Grails Acegi site that "You're encouraged to use the new Spring Security Core plugin instead which is the official Grails security plugin and will be actively maintained."

Have fun!