views:

22

answers:

1

Hi, I am working on a Twitter app. By going through the oAuth documentation and available scripts I am able to redirect the user to my callback uri and am receiving the user access object.

$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);
/* Get temporary credentials. */
$request_token = $connection->getRequestToken(OAUTH_CALLBACK);

What I understood is this is a permanent access object generated by twitter authorizing my app with this user. Do I need to save it in DB for further use. Is there any legal implications if I store user data.

My understanding is that we have to store the object in our DB and then use it when the user logs next time.

Can anyone confirm if this is the right approach. -Anand

A: 

You can store the access_token in a DB - that's not user data. That's your personal access key to their account. If you were instead storing their username/password to their account, that may be a problem.

xil3
ok. but isnt that user data is specific to the user.
anand
Yea, that access_token is specific to that users account, but that's YOUR access_token, not the users. The whole point is to retain that information for further use. If you disgard it everytime, it defeats the whole purpose.
xil3
point noted. Thanks. Is it enough to keep these two token and the UID whie saving data, because I see rest all are variable and can change at any point of time. Also for communicating with thrid party service,can it be used without making any changes. Third party like Twitpic or other which support oAuth.
anand
Yeah, once you have the auth_token + auth_token_secret, you just need to store those 2, plus your consumer_key and consumer_secret.... you'll be all set with that.
xil3
Thans a ton for your quick answers. They really helped me understandign the approach. cheers. have a nice day.
anand
You're welcome - if you could do me a favour and accept the answer, I'd be really happy :)
xil3
Sorry @xil3 it was my first post, so didnt knew how to accept the answer. Did it. cheers.
anand