forked from GNUsocial/gnu-social
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:
@@ -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
|
||||
*
|
||||
|
Reference in New Issue
Block a user