5 Optional Domain Classes - Reference Documentation
Authors:
Version: 2.0-SNAPSHOT
Table of Contents
5 Optional Domain Classes
The plugin provides support for using a GORM backedApprovalStore
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/Config.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/Config.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.yourappclass 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 } }