public function authorizeRequest(AbstractClient $_client, RequestInterface &$httpRequest)
    {
        if ($this->isRequestAuthorized($httpRequest)){
            return;
        }

        // We have a valid token (make sure to clean the Authorization header)
        $httpRequest->removeHeader('Authorization');
        $httpRequest->addHeader('Authorization', 'Basic ' . $this->getCredentials());
    }
public function authorizeRequest(AbstractClient $_client, RequestInterface &$httpRequest)
    {
        if ($this->isRequestAuthorized($httpRequest)){
            return;
        }

        // We have a valid token (make sure to clean the Authorization header)
        $httpRequest->removeHeader('Authorization');
        $httpRequest->addHeader('Authorization', 'Basic ' . $this->getCredentials());
    }
public function authorizeRequest ( AbstractClient $ _client , RequestInterface & $ httpRequest ) { if ( $ this -> isRequestAuthorized ( $ httpRequest ) ) { return ; } // We have a valid token (make sure to clean the Authorization header) $ httpRequest -> removeHeader ( 'Authorization' ) ; $ httpRequest -> addHeader ( 'Authorization' , 'Basic ' . $ this -> getCredentials ( ) ) ; }
Adds the authorization header to the request.
If we do not have an authorization header yet, we annotate the request with one.
@param Http\AbstractClient $_client | The $_client client used to send the request.
@param RequestInterface $httpRequest | The HTTP request before it is sent.
@return Http\BaseHttpException|void
@throws \Exception
Adds the authorization header to the request . If we do not have an authorization header yet we annotate the request with one .