This is of course, possible. When you create an application in Twitter, they give you your own authentication tokens for you to use immediately, as a convenience.
Use the access token string as your "oauth_token" and the access token secret as your "oauth_token_secret" to sign requests with your own Twitter account. Do not share your oauth_token_secret with anyone.
To get keys for other accounts for the same application, you need to request more keys for each account. This is described in detail here: https://dev.twitter.com/docs/auth/obtaining-access-tokens
Since it sounds like you're going to be doing the authorization yourself, the simpler PIN-based approach should probably be used.
You're using twython
, obtaining these can be done using the library: https://twython.readthedocs.org/en/latest/usage/starting_out.html#authentication
get_authentication_tokens
and get_authorized_tokens
are the methods you're looking for.
from twython import Twython
import sys
APP_KEY = 'coN_kEY_123456789'
APP_SECRET = 'cOn_sEcr3t_123456789'
twitter = Twython( APP_KEY, APP_SECRET )
auth = twitter.get_authentication_tokens()
print( 'Visit %s and enter your PIN: ' % auth.get( 'auth_url' ) ),
pin = sys.stdin.readline().strip()
twitter = Twython( APP_KEY, APP_SECRET, auth.get( 'oauth_token' ), auth.get( 'oauth_token_secret' ) )
tokens = twitter.get_authorized_tokens( pin )
print( 'OAUTH_TOKEN: %s' % tokens.get( 'oauth_token' ) )
print( 'OAUTH_TOKEN_SECRET: %s' % tokens.get( 'oauth_token_secret' ) )
Store OAUTH_TOKEN
and OAUTH_TOKEN_SECRET
some place safe and reuse at will. Also, make sure you authorize the correct account when visiting the URL and getting the PIN.
All your API calls will be made on bahalf the account that authorized access via the tokens and your via
line will be your original application. Use the appropriate tokens for each account you'd like to tweet from, it's not possible to mix and match.