Uploaded image for project: 'Spring Social Facebook'
  1. Spring Social Facebook
  2. SOCIALFB-101

Enable FacebookTemplate to be created with both a user access token and an app access token



    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: API Binding, Connection
    • Labels:


      Most Facebook Graph API endpoints (and corresponding Spring Social Facebook API binding methods) require a user access token. But some operations, such as posting a notification, require an app access token from Facebook.

      In OAuth2 terminology, most endpoints require an access token obtained via Authorization Code Grant or Resource Owner Credentials Grant, but some require an access token obtained via Client Credentials Grant. (User tokens can also be obtained via Implicit Grant, but that grant is intended for client-side use whereas Spring Social's API bindings are intended for server-side use.)

      So that an application doesn't have to maintain two separate instances of FacebookTemplate (one for the current user and one for the application itself), there should be a way to construct a FacebookTemplate that holds both a user token and an app token.

      This task is more than simply adding another constructor argument. There will likely need to be work done in the connection framework to support providing a FacebookTemplate that contains an app token. Also, the app token should be optional. And, ideally the app token should only be obtained once and cached so that the connection framework doesn't try to obtain it every time that a request-scoped instance of FacebookTemplate is created for each user.

      Also note that I'm recording this issue in the context of Spring Social Facebook, as that is where it is most likely to be useful. But this issue should be considered more generally and it should be determined whether or not any changes should be applied to Spring Social Core's connection framework to enable this for all providers.




            habuma Craig Walls
            habuma Craig Walls
            1 Vote for this issue
            3 Start watching this issue