Upgrade Twitter bridge to use OAuth 1.0a. It's more secure, and allows

us to automatically send in a callback url instead of having to manually
configure one for each StatusNet instance.
This commit is contained in:
Zach Copley
2010-02-16 06:12:08 +00:00
parent 0ba3759171
commit f414544d0d
3 changed files with 98 additions and 28 deletions

View File

@@ -91,6 +91,19 @@ class TwitterOAuthClient extends OAuthClient
}
}
/**
* Gets a request token from Twitter
*
* @return OAuthToken $token the request token
*/
function getRequestToken()
{
return parent::getRequestToken(
self::$requestTokenURL,
common_local_url('twitterauthorization')
);
}
/**
* Builds a link to Twitter's endpoint for authorizing a request token
*
@@ -107,6 +120,21 @@ class TwitterOAuthClient extends OAuthClient
common_local_url('twitterauthorization'));
}
/**
* Fetches an access token from Twitter
*
* @param string $verifier 1.0a verifier
*
* @return OAuthToken $token the access token
*/
function getAccessToken($verifier = null)
{
return parent::getAccessToken(
self::$accessTokenURL,
$verifier
);
}
/**
* Calls Twitter's /account/verify_credentials API method
*