Esempio n. 1
0
 public function getRefreshAccessToken($client_id, $client_secret, $refresh_token)
 {
     $this->client->setCustomHeader(array("Authorization: Basic " . base64_encode($client_id . ":" . $client_secret)));
     $this->client->setPostParams(array("refresh_token" => urlencode($refresh_token), "client_secret" => urlencode($client_secret), "grant_type" => $refresh_token), false);
     $response = new AccessTokenResponse($this->client->post($this->apiMode->getApiBaseUrl() . $this->accessTokenPath));
     $this->accessTokenStorage->store($response);
     return $response;
 }
Esempio n. 2
0
 public function __construct(Mode $apiMode, AccessTokenStorage $accessTokenStorage)
 {
     $this->apiMode = $apiMode;
     $this->client = new HTTPClient();
     $this->getClient()->setCustomHeader(array("Authorization: OAuth " . $accessTokenStorage->getAccessToken(), 'Content-Type: application/json'));
 }