public static function GetRequestToken(OAuthConsumer $consumer, $scope,
      $endpoint, $applicationName, $callbackUrl) {
    $signatureMethod = new OAuthSignatureMethod_HMAC_SHA1();

    // Set parameters.
    $params = array();
    $params['scope'] = $scope;
    if (isset($applicationName)) {
      $params['xoauth_displayname'] = $applicationName;
    }
    if (isset($callbackUrl)) {
      $params['oauth_callback'] = $callbackUrl;
    }

    // Create and sign request.
    $request = OAuthRequest::from_consumer_and_token($consumer, NULL, 'GET',
        $endpoint, $params);
    $request->sign_request($signatureMethod, $consumer, NULL);

    // Get token.
    return self::GetTokenFromUrl($request->to_url());
  }
public static function GetRequestToken(OAuthConsumer $consumer, $scope,
      $endpoint, $applicationName, $callbackUrl) {
    $signatureMethod = new OAuthSignatureMethod_HMAC_SHA1();

    // Set parameters.
    $params = array();
    $params['scope'] = $scope;
    if (isset($applicationName)) {
      $params['xoauth_displayname'] = $applicationName;
    }
    if (isset($callbackUrl)) {
      $params['oauth_callback'] = $callbackUrl;
    }

    // Create and sign request.
    $request = OAuthRequest::from_consumer_and_token($consumer, NULL, 'GET',
        $endpoint, $params);
    $request->sign_request($signatureMethod, $consumer, NULL);

    // Get token.
    return self::GetTokenFromUrl($request->to_url());
  }
public static function GetRequestToken ( OAuthConsumer $ consumer , $ scope , $ endpoint , $ applicationName , $ callbackUrl ) { $ signatureMethod = new OAuthSignatureMethod_HMAC_SHA1 ( ) ; // Set parameters. $ params = array ( ) ; $ params [ 'scope' ] = $ scope ; if ( isset ( $ applicationName ) ) { $ params [ 'xoauth_displayname' ] = $ applicationName ; } if ( isset ( $ callbackUrl ) ) { $ params [ 'oauth_callback' ] = $ callbackUrl ; } // Create and sign request. $ request = OAuthRequest :: from_consumer_and_token ( $ consumer , NULL , 'GET' , $ endpoint , $ params ) ; $ request -> sign_request ( $ signatureMethod , $ consumer , NULL ) ; // Get token. return self :: GetTokenFromUrl ( $ request -> to_url ( ) ) ; }
Using the consumer and scope provided, a request is made to the endpoint
to generate an OAuth request token.
@param OAuthConsumer $consumer the consumer
@param string $scope the scope of the application to authorize
@param string $endpoint the OAuth endpoint to make the request against
@param string $applicationName optional name of the application to display
on the authorization redirect page
@param string $callbackUrl optional callback URL
@return OAuthToken a request token
@see http://code.google.com/apis/accounts/docs/OAuth_ref.html#RequestToken
Using the consumer and scope provided a request is made to the endpoint to generate an OAuth request token .