diff options
author | Zach Copley <zach@status.net> | 2010-02-16 06:12:08 +0000 |
---|---|---|
committer | Zach Copley <zach@status.net> | 2010-02-16 06:12:08 +0000 |
commit | f414544d0d289df2c103d9b16400e1ed91d35e91 (patch) | |
tree | 9ad75a2b90c3a56932d05bc04b98468471f97678 /plugins/TwitterBridge/twitteroauthclient.php | |
parent | 0ba375917129eaee2608203ed532efb3b9db879c (diff) |
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.
Diffstat (limited to 'plugins/TwitterBridge/twitteroauthclient.php')
-rw-r--r-- | plugins/TwitterBridge/twitteroauthclient.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/plugins/TwitterBridge/twitteroauthclient.php b/plugins/TwitterBridge/twitteroauthclient.php index 277e7ab40..ba45b533d 100644 --- a/plugins/TwitterBridge/twitteroauthclient.php +++ b/plugins/TwitterBridge/twitteroauthclient.php @@ -92,6 +92,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 * * @param OAuthToken $request_token token to authorize @@ -108,6 +121,21 @@ class TwitterOAuthClient extends OAuthClient } /** + * 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 * * @return mixed the Twitter user |