What I am trying to do is as follows (psuedocode):
t_username = 'XXXXX';
t_password = 'XXXXX';
app_key = 'XXXXX';
app_secret = 'XXXXX';
function login(uname, pword, key, secret) {
/* Returns something like: [access_token, token_secret] */
}
toks = login(t_username, t_password, app_key, app_secret);
/* Use the 'toks' to make API calls */
I think what basically will solve my problem is a URI to which I can POST the twitter username and password along with the key and secret and which returns the access token and secret that can be used to make Streaming or REST API calls.