Announcement Announcement Module
No announcement yet.
One App. Single Account -> Perform Operations Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • One App. Single Account -> Perform Operations

    Hello everyone,

    I am starting to use Spring Social so this might by an easy answer but I have googled a lot of websites and I haven't found anything about it.

    All the websites have examples related to letting the user connect to their social network site and perform actions in it (changing status, posting messages, etc).
    The problem is that in my application, I don't want to let the user connect to a social network. I just want my application to connect with a single account to twitter and facebook and perform operations if something happens in the site. (new entries, user registrations, etc)

    Is this possible with Spring Social? Any suggestions? Anybody knows a site/tutorial/book that explains how to do this?

    Thanks in advance.

  • #2
    Do I understand you correctly to say that you simply want your app to be hard-wired to a known account (perhaps your own account)? If so, then you can bypass the connection stuff in Spring Social and create an instance of FacebookTemplate or TwitterTemplate, giving it an access token you obtain separately.

    How you get that access token will depend on the provider you're interested in.
    - For Twitter, you are already given an access token when you register your app. Go to your app's details page in Twitter's development area and you'll find a section called "Your Access Token".
    - For Facebook, I find it easy to go to their Graph API Explorer (), click the "Get Access Token" button, select the permissions for that token, and then copy it out of the Access Token field.

    If that's not what you had in mind, please explain more about what it is you're trying to do.


    • #3
      That's exactly what I needed habuma. Thank you.

      A few more questions... to make it last forever I need to set "offline access", right? Is this available in twitter and linkedin?
      Do you remember how to get the auth token in Linkedin?

      Thanks again.


      • #4
        For Facebook, need "offline_access", which will last virtually forever (or until you change the password or revoke access). For Twitter and LinkedIn, their tokens do not expire, so they are valid until revoked.

        As for how to get a LinkedIn token...I don't know if there's a convenient way like there is with Facebook and Twitter. One slightly inconvenient way that I've used is to use OAuth1Template to fetch a request token and generate a authorization URL for you. Then use that URL to authorize your app and get a verifier. Finally using OAuth1Template, exchange the request token and verifier for an access token.


        • #5
          Ok! Thanks for the tips


          • #6
            Thanks for useful and informative tips for all of us.