public static function GetAccessToken(OAuthConsumer $consumer,
      OAuthToken $token, $verifier, $endpoint) {
    $signatureMethod = new OAuthSignatureMethod_HMAC_SHA1();

    // Set parameters.
    $params = array();
    $params['oauth_verifier'] = $verifier;

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

    // Get token.
    return self::GetTokenFromUrl($request->to_url());
  }