简体   繁体   中英

Rename the user field on FacebookUser with Spring Security Facebook Grails Plugin

I'm using the Spring Security Facebook Plugin with Grails 3, and my Spring Security user domain class is call Person . The documentation instruct us to create the FacebookUser domain class like with a belongs to relationship to the User class...

from plugin docs:

class FacebookUser {
  ...    
  static belongsTo = [user: User] //connected to main Spring Security domain
  ...    
  }
}

I want to know if I can do this...

  static belongsTo = [person: Person]

or do I have to do this...

  static belongsTo = [user: Person]

Thanks in advance for your help.

I think I found the answer here: http://splix.github.io/grails-spring-security-facebook/#configure-domains . You just need to configure appUserConnectionPropertyName like this...

grails:
    plugin:
        springsecurity:
            facebook:
                domain:
                    classname: 'co.sharptop.app.FacebookUser'
                    appUserConnectionPropertyName: 'person'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM