diff --git a/src/HttpClient/Plugin/Authentication.php b/src/HttpClient/Plugin/Authentication.php index 816ffdc..06b1d43 100644 --- a/src/HttpClient/Plugin/Authentication.php +++ b/src/HttpClient/Plugin/Authentication.php @@ -34,7 +34,7 @@ public function __construct(string $tokenOrLogin, ?string $password, ?string $me public function doHandleRequest(RequestInterface $request, callable $next, callable $first): Promise { $request = $request->withHeader( - 'Authorization', + 'X-API-Key', $this->getAuthorizationHeader() ); @@ -45,7 +45,7 @@ private function getAuthorizationHeader(): string { switch ($this->method) { case Client::AUTH_ACCESS_TOKEN: - return sprintf('Bearer %s', $this->tokenOrLogin); + return $this->tokenOrLogin; default: throw new RuntimeException(sprintf('%s not yet implemented', $this->method)); }