(Quick Reference)

5 Optional Domain Classes - Reference Documentation

Authors: Brian Saville, Bobby Vandiver, Roy Willemse

Version: 3.0.0-RC2

Table of Contents

5 Optional Domain Classes

The plugin provides support for using a GORM backed ApprovalStore with the ApprovalStoreUserApprovalHandler provided by the underlying Spring OAuth library. This class is only required if the consuming application is configured to use the UserApprovalSupport.APPROVAL_STORE method of auto-approval.

The s2-init-oauth2-approval script will create the required domain class for you in a specified package and update grails-app/conf/application.groovy so the plugin recognizes it. You can customize the generated class to fit your needs. If you change the default property names, you will need to update grails-app/conf/application.groovy so the plugin is aware of the changes. See the section on domain class properties for more information.

The below discussion assumes the s2-init-oauth2-approval script has been run with com.yourapp specified as the package and Approval as the name of the domain class.

5.1 Approval Class

This class represents a prior scoped approval granted to a client by a user.

package com.yourapp

class Approval {

String username String clientId

String scope boolean approved

Date expiration Date lastModified

static constraints = { username nullable: false, blank: false clientId nullable: false, blank: false scope nullable: false, blank: false expiration nullable: false lastModified nullable: false } }