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

        // 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, $tokenSecret);

        // request access 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 accessToken(Url $url, $consumerKey, $consumerSecret, $token, $tokenSecret, $verifier, $method = 'HMAC-SHA1')
    {
        $values = array(
            'oauth_consumer_key'     => $consumerKey,
            'oauth_token'            => $token,
            'oauth_signature_method' => $method,
            'oauth_timestamp'        => self::getTimestamp(),
            'oauth_nonce'            => self::getNonce(),
            'oauth_version'          => self::getVersion(),
            'oauth_verifier'         => $verifier,
        );

        // 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, $tokenSecret);

        // request access 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 accessToken ( Url $ url , $ consumerKey , $ consumerSecret , $ token , $ tokenSecret , $ verifier , $ method = 'HMAC-SHA1' ) { $ values = array ( 'oauth_consumer_key' => $ consumerKey , 'oauth_token' => $ token , 'oauth_signature_method' => $ method , 'oauth_timestamp' => self :: getTimestamp ( ) , 'oauth_nonce' => self :: getNonce ( ) , 'oauth_version' => self :: getVersion ( ) , 'oauth_verifier' => $ verifier , ) ; // 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 , $ tokenSecret ) ; // request access 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 ( ) ) ; }
Exchange an request token with an access token. We receive the "token"
and "verifier" from the service provider wich redirects the user to the
callback in this redirect are the $token and $verifier. Returns an access
token and secret i.e.
<code>
$response = $oauth->accessToken(...);

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

@see http://tools.ietf.org/html/rfc5849#section-2.3
@param \PSX\Uri\Url $url
@param string $consumerKey
@param string $consumerSecret
@param string $token
@param string $tokenSecret
@param string $verifier
@param string $method
@return \PSX\Oauth\Data\Response
Exchange an request token with an access token . We receive the token and verifier from the service provider wich redirects the user to the callback in this redirect are the $token and $verifier . Returns an access token and secret i . e . <code > $response = $oauth - > accessToken ( ... ) ;