Exemple #1
0
 /**
  * Makes a curl connection
  */
 protected function curl($method, $url, $data = [], $headers = [])
 {
     if (!isset($headers['Content-Type'])) {
         $headers['Content-Type'] = 'application/json';
     }
     return parent::curl($method, $url, $data, $headers);
 }
Exemple #2
0
 /**
  * Gets the access and refresh tokens from the token endpoint
  * @param  string $type The grant type to use
  * @param  array  $data Data to send to the endpoint
  * @return array
  */
 public function grant($type, $data = [])
 {
     $base64 = base64_encode($this->id . ':' . $this->secret);
     $this->tokenHeaders = ['Authorization' => 'Basic ' . $base64];
     return parent::grant($type, $data);
 }