Results 1 to 6 of 6

Thread: One App. Single Account -> Perform Operations

  1. #1
    Join Date
    Oct 2011
    Posts
    14

    Question 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. #2
    Join Date
    Aug 2004
    Posts
    1,075

    Default

    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.
    Craig Walls
    Spring Social Project Lead

  3. #3
    Join Date
    Oct 2011
    Posts
    14

    Default

    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. #4
    Join Date
    Aug 2004
    Posts
    1,075

    Default

    For Facebook, yes...you 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.
    Craig Walls
    Spring Social Project Lead

  5. #5
    Join Date
    Oct 2011
    Posts
    14

    Default

    Ok! Thanks for the tips

  6. #6

    Default

    Thanks for useful and informative tips for all of us.
    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •