Announcement Announcement Module
No announcement yet.
Is it possible to use Spring Social in a non web-based project? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is it possible to use Spring Social in a non web-based project?

    I want to develop a Spring Social project to retrieve some posts from a Facebook Page, but I get MissingAuthorizationException on calling getFeeds(String, int, int).

    And I could not find a way to create a token in a non-web-based application in the samples.

    Could anybody help?

    (I want to pass my username and password from a non-web-based app, without using facebook page).


  • #2
    The connection support in Spring Social is certainly focused on 3-legged OAuth 1 and what is known in the OAuth 2 spec as "Authorization Code" and "Implicit Grant" authorization, which are web-based (at least so much as to redirect the user's browser for authorization. With regard to Facebook, "Authorization Code" authorization is suitable for web apps and "Implicit Grant" is more suitable for web-enabled clients (such as an Android app).

    In fact, the Spring Android Showcase sample ( uses Spring Social and Implicit Grant. This shows that Spring Social can be used with non-web apps, but there still is a web-related step as the app is redirected to Facebook for authorization.

    OAuth 2 does, however, offer other authorization types, including "Resource Owner Password Credentials" which is a much simpler form of OAuth where the client knows the user's provider credentials and exchanges those for an access token and does not require a browser redirect for authorization. Spring Social does not yet support this type of authorization, but we are looking considering adding it in 1.1.

    In the meantime, your app could do the Resource Owner Password Credentials authorization ( itself to obtain the access token and then use that to create a connection or a FacebookTemplate. So, although this form of authorization is not yet directly supported, once you have an access token (however you get it), you can use it to create a connection or API binding.