/** * 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); }
/** * 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); }