/**
  * Returns the protected resource.
  *
  * @param string $url url to request.
  * @param array $options HTTP request options. Keys: query, data, referer.
  * @param boolean $parseResponse Whether to parse response.
  * @return mixed the response.
  */
 public function makeSignedRequest($url, $options = array(), $parseResponse = true)
 {
     $token = $this->getAccessTokenData();
     if (isset($token)) {
         $params = '';
         ksort($options['query']);
         foreach ($options['query'] as $k => $v) {
             $params .= $k . '=' . $v;
         }
         $options['query']['sig'] = md5($params . md5($token['access_token'] . $this->clientSecret));
         $options['query']['access_token'] = $token['access_token'];
     }
     return parent::makeSignedRequest($url, $options, $parseResponse);
 }
示例#2
0
 /**
  * @param CredentialsInterface $credentials
  * @param ClientInterface $httpClient
  * @param TokenStorageInterface $storage
  * @param array $scopes
  * @param UriInterface $baseApiUri
  * @param Service $service
  */
 public function __construct(CredentialsInterface $credentials, ClientInterface $httpClient, TokenStorageInterface $storage, $scopes = array(), UriInterface $baseApiUri = null, Service $service)
 {
     $this->service = $service;
     parent::__construct($credentials, $httpClient, $storage, $scopes, $baseApiUri, $service->getValidateState());
 }
示例#3
0
 /**
  * Returns the protected resource.
  *
  * @param string $url url to request.
  * @param array $options HTTP request options. Keys: query, data, referer.
  * @param boolean $parseResponse Whether to parse response.
  * @return mixed the response.
  */
 public function makeSignedRequest($url, $options = array(), $parseResponse = true)
 {
     if (!isset($options['query']['alt'])) {
         $options['query']['alt'] = 'json';
     }
     return parent::makeSignedRequest($url, $options, $parseResponse);
 }
示例#4
0
 /**
  * @return array
  */
 public function getAccessTokenArgumentNames()
 {
     $names = parent::getAccessTokenArgumentNames();
     $names['expires_in'] = 'expires';
     return $names;
 }