Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a reason the Bearer authorization header is not used? #25

Closed
jtsternberg opened this issue Nov 14, 2018 · 3 comments · Fixed by #31
Closed

Is there a reason the Bearer authorization header is not used? #25

jtsternberg opened this issue Nov 14, 2018 · 3 comments · Fixed by #31

Comments

@jtsternberg
Copy link

We have a working Drip integration, but were looking to switch to the official library. But the way authentication happens does not work for us (we get authentication errors). However if switch to using the Bearer authorization token header, things work as expected. E.g.

... 
$client = new \GuzzleHttp\Client();

$req_params = [
    'base_uri' => $this->api_end_point,
    'handler' => $stack,
    'timeout' => $this->timeout,
    'connect_timeout' => $this->connect_timeout,
    'http_errors' => false,
    'headers'  => array(
        'User-Agent' => $this->user_agent(),
        'Accept' => 'application/json, text/javascript, */*; q=0.01',
        'Content-Type' => 'application/vnd.api+json',
    	'Authorization' => 'Bearer ' . $this->api_token,
    ),
];
... switch case statement ...

$res = $client->request($req_method, $url, $req_params); 
@jtsternberg
Copy link
Author

Anyone home?

@will-in-wi
Copy link
Contributor

Hey, sorry, this got overlooked. We haven't been spending much time on this client in a while, but I'll throw a ticket in the queue for this.

@tiannaavery
Copy link
Contributor

Thanks for your patience on this one! Version 1.4.0 has a new client definition that supports Bearer authentication.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants