Spring Security authentication with Groovy Grails setup
In this recipe we shall first set up Groovy and Grails. We shall then show how to integrate Spring Security with Grails.
Getting ready
Get Groovy installed from http://groovy.codehaus.org/Download
Download Grails 2.3 from http://groovy.codehaus.org/Download and unzip it to a folder
Set environment variable:
GRAILS_HOME
Check for
Groovy_HOME
Check Grails installation by typing
grails-version
How to do it…
The following steps are taken to integrate Spring Security with Groovy Grails:
Create a directory:
Grails Project
.cd Grails_Project grails create-app myfirstapp cd myfirstapp grails create-controller MyFirstController
This will create a controller which will be available inside the controller package.
You can open the generated controller file and view it. It will have package name
myfirstapp
which Grails has auto generated.package myfirstapp class MyFirstController { def index() { } }
Update the generated controller file.
package myfirstapp...