Question

I just got done walking through the install instructions on this page:
http://grails.org/plugin/spring-security-facebook

I choose AuthUser for the User domain object name and AuthRole as my Role domain object name. In all other questions I choose the defaults or put in my Facebook App ID or Facebook App Secret.

At the end of the process I have a AuthUser as my User. I also have a FacebookUser that implements FacebookUserDomain.

When I try to run the app it tells me I haven't implemented getAccessToken or setAccessToken in my FacebookUser. This is being required by the FacebookUserDomain interface. Is this normal? Does the documentation need to be completed? What is the correct way to handle this?

UPDATE
Here is the FacebookUser class code I tried to use to solve the problem.

class FacebookUser implements FacebookUserDomain {
  long uid
  String secret
  String session
  String email
  String accessToken

  static belongsTo = [user: AuthUser]

  static constraints = {
    uid unique: true
  }

  public String getAccessToken() {
    return accessToken
  }

  public void setAccessToken(String accessToken) {
    this.accessToken = accessToken
  }
}

Also getting this error:Configuring Spring Security Core ... ... finished configuring Spring Security Core

Configuring Spring Security Facebook ... ERROR: There is no dao configired for Facebook Auth ERROR: Stop configuring Spring Security Facebook 2011-12-19 19:17:30,261 [main] ERROR util.JDBCExceptionReporter - Unknown colum n 'deactivate_code' in 'where clause' could not execute native bulk manipulation query 2011-12-19 19:17:30,496 [main] ERROR context.GrailsContextLoader - Error execut ing bootstraps: No property found for name [facebookId] for class [class lmfirst .AuthUser] org.codehaus.groovy.grails.exceptions.InvalidPropertyException: No property foun d for name [facebookId] for class [class lmfirst.AuthUser] at lmfirst.UtilService.createMayor(UtilService.groovy:20)

Was it helpful?

Solution

You don't need to make get/set for accessToken, as it automaticaly added by Groovy itself. Having String accessToken is enought

As about Facebook Auth dao - did you executed grails s2-init-facebook? It generates default Dao implementation for you, and register it at conf/spring/resources.groovy

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top