function TwitterOAuth::getXAuthToken in Tweet Feed 6
Same name and namespace in other branches
- 7.3 inc/twitter-oauth.inc \TwitterOAuth::getXAuthToken()
- 7 inc/twitter-oauth.inc \TwitterOAuth::getXAuthToken()
- 7.2 inc/twitter-oauth.inc \TwitterOAuth::getXAuthToken()
One time exchange of username and password for access token and secret.
@returns array("oauth_token" => "the-access-token", "oauth_token_secret" => "the-access-secret", "user_id" => "9436992", "screen_name" => "abraham", "x_auth_expires" => "0")
File
- inc/
twitter-oauth.inc, line 127
Class
- TwitterOAuth
- Twitter OAuth class
Code
function getXAuthToken($username, $password) {
$parameters = array();
$parameters['x_auth_username'] = $username;
$parameters['x_auth_password'] = $password;
$parameters['x_auth_mode'] = 'client_auth';
$request = $this
->oAuthRequest($this
->accessTokenURL(), 'POST', $parameters);
$token = OAuthUtil::parse_parameters($request);
$this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']);
return $token;
}