AcegiSecurity Plugin - Scripts

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

  • creates grails-app/conf/SecurityConfig.groovy to allow configuration of required parameters and also to allow overriding of default values
  • creates Acegi domain classes in grails-app/domain and registers their names in SecurityConfig.groovy
    • if you omit both 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)
    • if you specify one parameter it will be used as the User class name and you'll be prompted for the name of the Role class
    • if you specify both class names they will be used
  • 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
    • grails-app/controllers/LoginController.groovy - manages login workflow
    • grails-app/controllers/LogoutController.groovy - logs users out of the application
      Unlike creating domain classes via 'grails create-domain-class', you cannot currently specify a package for these domain classes. You can move the classes into a package after they're generated as long as you update the name (full class name with package) in SecurityConfig.groovy.

generate-manager

  • 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)

generate-registration

  • creates classes to manage user registration:
    • grails-app/controllers/RegisterController.groovy
      • manages user registration, including using a Captcha to 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
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.