src/Consumer.php
public function requestToken(Url $url, $consumerKey, $consumerSecret, $method = 'HMAC-SHA1', $callback = null)
    {
        $values = array(
            'oauth_consumer_key'     => $consumerKey,
            'oauth_signature_method' => $method,
            'oauth_timestamp'        => self::getTimestamp(),
            'oauth_nonce'            => self::getNonce(),
            'oauth_version'          => self::getVersion(),
        );

        // if we have an callback add them to the request
        if (!empty($callback)) {
            $values['oauth_callback'] = $callback;
        } else {
            $values['oauth_callback'] = 'oob';
        }

        // build the base string
        $requestMethod = 'POST';
        $params        = array_merge($values, $url->getParameters());
        $baseString    = self::buildBasestring($requestMethod, $url, $params);

        // get the signature object
        $signature = self::getSignature($method);

        // generate the signature
        $values['oauth_signature'] = $signature->build($baseString, $consumerSecret);

        // request unauthorized token
        $request  = new PostRequest($url, array(
            'Authorization' => 'OAuth realm="psx", ' . self::buildAuthString($values),
            'User-Agent'    => __CLASS__,
        ));
        $response = $this->client->request($request);

        // parse the response
        return $this->importer->import(new Response(), (string) $response->getBody());
    }
public function requestToken(Url $url, $consumerKey, $consumerSecret, $method = 'HMAC-SHA1', $callback = null)
    {
        $values = array(
            'oauth_consumer_key'     => $consumerKey,
            'oauth_signature_method' => $method,
            'oauth_timestamp'        => self::getTimestamp(),
            'oauth_nonce'            => self::getNonce(),
            'oauth_version'          => self::getVersion(),
        );

        // if we have an callback add them to the request
        if (!empty($callback)) {
            $values['oauth_callback'] = $callback;
        } else {
            $values['oauth_callback'] = 'oob';
        }

        // build the base string
        $requestMethod = 'POST';
        $params        = array_merge($values, $url->getParameters());
        $baseString    = self::buildBasestring($requestMethod, $url, $params);

        // get the signature object
        $signature = self::getSignature($method);

        // generate the signature
        $values['oauth_signature'] = $signature->build($baseString, $consumerSecret);

        // request unauthorized token
        $request  = new PostRequest($url, array(
            'Authorization' => 'OAuth realm="psx", ' . self::buildAuthString($values),
            'User-Agent'    => __CLASS__,
        ));
        $response = $this->client->request($request);

        // parse the response
        return $this->importer->import(new Response(), (string) $response->getBody());
    }
Requests a new "request token" from the $url using the consumer key and
secret. The $url must be valid request token endpoint. Returns an array
with all key values pairs from the response i.e.
<code>
$response = $oauth->requestToken(...);

$token       = $response->getToken();
$tokenSecret = $response->getTokenSecret();
</code>

@see http://tools.ietf.org/html/rfc5849#section-2.1
@param \PSX\Uri\Url $url
@param string $consumerKey
@param string $consumerSecret
@param string $method
@param string $callback
@return \PSX\Oauth\Data\Response