frankkessler/guzzle-oauth2-middleware

Base uri needed on getToken Oauth2Client class

Opened this issue · 1 comments

On getToken method, you instantiate a new Guzzle Client to get a new token on line 236

$response = $client->post($config['token_url'], $requestOptions);

But you didn't set base_uri on this instance, so response always return "Could not resolve host: oauth".

I had to add the following code to get it working:

if (isset($this->config['base_uri'])) {
   $token_client_config['base_uri'] = $this->config['base_uri'];
}

One temporary workaround is to use an absolute URI when configuring grant object with token_url.