Last updated by burtbeckwith 8 years ago

create-auth-domains [class name for User] [class name for Role] [class name for Requestmap]

  • creates grails-app/conf/SecurityConfig.groovy to allow configuration of required parameters and also to allow overriding of default values
  • creates Spring Security domain classes in grails-app/domain and registers their names in SecurityConfig.groovy
    • if you omit all parameters, the script will create a 'Person' user class and 'Authority' role class, and a 'Requestmap' class to store URL restrictions in the database (optional functionality)
    • you can specify all three class names, including packages, if you don't want to use the default names and/or put your classes in the default package
  • creates example web-tier classes:
    • grails-app/views/login/auth.gsp - shows a standard username/password login page
    • grails-app/views/login/openIdAuth.gsp - shows a username-only OpenId login page (optional, can be deleted if not used)
    • grails-app/controllers/LoginController.groovy - manages login workflow
    • grails-app/controllers/LogoutController.groovy - logs users out of the application


  • creates a Controller class in grails-app/controllers for each of the domain classes
  • creates view GSPs (create.gsp, edit.gsp, list.gsp, show.gsp) for each of the domain classes
You can use your own controllers and/or view pages or use the Grails scripts (create-controller, generate-controller, generate-views, generate-all)


  • creates classes to manage user registration:
    • grails-app/controllers/RegisterController.groovy
      • manages user registration, including using a Captcha to help prevent non-human registration
    • GSPs in grails-app/view/register for user registration, used by RegisterController
    • grails-app/controllers/CaptchaController.groovy
      • renders the Captcha image and stores the inner text in the Session for comparison on submit
    • grails-app/services/EmailerService.groovy
      • a simple email sending service that uses Spring's MailSender
      • Note - this is optional and can be disabled in SecurityConfig.groovy if you don't want emails sent after successful registration
  • Downloads mail.jar and activation.jar for use by EmailerService.groovy