[twitter-dev] One account to rule them all: questions

2010-04-20 Thread luisg
Hello people,

I'm trying to do something that I don't know if will work. Let me
explain the main idea:

1) A user 'login with twitter' in my application;
2) This user should have the possibility to 'add account'. This means
that, if a user owns more than 1 account, we will associate the 1st
account (the one he logged in: main account) and the new he want to
add (sub account). The goal is to tweet to sub-accounts as well as
edit sub-account details from main account.

The thing is, after I login with the main account, and if a want to
add a new sub-account, I have to go to twitter, enter sub-account user
and passwords, to get all the information so I can store in my DB.
But, when I give this account name and password, I don't want to login
(cause I'm already with the main account), I just want to retrieve the
information (especially the access token and secret).

Is possible to get access token and secret giving the account name and
password but without login? Doing that with human interaction would be
great, but I need to go to twitter always, right?

Any of you have an idea how can I do this?

Thanks,

Luis Gonçalves


-- 
Subscription settings: 
http://groups.google.com/group/twitter-development-talk/subscribe?hl=en


Re: [twitter-dev] One account to rule them all: questions

2010-04-20 Thread Taylor Singletary
Hi Luis,

I first want to make very clear that you shouldn't store logins and
passwords. Twitter's API will never return to you the password for a user,
and with the exception of using xAuth for Desktop  Mobile applications, you
should never be sending logins and passwords to the Twitter API. Basic Auth
will be deprecated in June and you should basically act as if it doesn't
exist now.

If your application is a web application, you should be using OAuth to first
establish a request token, then send the user to our OAuth Authorization
screen where they'll enter their account credentials, after which they'll be
sent to the oauth_callback URL (your application) that you specified in the
request token step. You'll then exchange that request token for an access
token, which you can then store in your database for further use until the
permission is revoked by your user.

Login with Twitter is not a means for you to store account credentials for
re-use through mechanization or otherwise with the Twitter.com website.

This diagram illustrates the OAuth flow succinctly:
http://oauth.net/core/diagram.png

To Kovshenin's point, Twitter will be rolling out a Contributors API feature
when it's ready. This allows for a single Twitter account to be managed by
sub-accounts, so that @reallycoolcompany's tweets come from
@reallycoolcompany but @jessica or @donald who work at @reallycoolcompany
don't have to know the account credentials for @reallycoolcompany to tweet
from the account. This is still a ways out.

Hope this helps clear it up.

Taylor Singletary
Developer Advocate, Twitter
http://twitter.com/episod


On Tue, Apr 20, 2010 at 6:41 AM, luisg luisfmgoncal...@gmail.com wrote:

 Hello people,

 I'm trying to do something that I don't know if will work. Let me
 explain the main idea:

 1) A user 'login with twitter' in my application;
 2) This user should have the possibility to 'add account'. This means
 that, if a user owns more than 1 account, we will associate the 1st
 account (the one he logged in: main account) and the new he want to
 add (sub account). The goal is to tweet to sub-accounts as well as
 edit sub-account details from main account.

 The thing is, after I login with the main account, and if a want to
 add a new sub-account, I have to go to twitter, enter sub-account user
 and passwords, to get all the information so I can store in my DB.
 But, when I give this account name and password, I don't want to login
 (cause I'm already with the main account), I just want to retrieve the
 information (especially the access token and secret).

 Is possible to get access token and secret giving the account name and
 password but without login? Doing that with human interaction would be
 great, but I need to go to twitter always, right?

 Any of you have an idea how can I do this?

 Thanks,

 Luis Gonçalves


 --
 Subscription settings:
 http://groups.google.com/group/twitter-development-talk/subscribe?hl=en