I've created a custom Provider for Laravel Socialite. The authentication part is going well until i'll try to call the user method.
Not sure what's going wrong. Method documentation at wunderlist
My code:
/**
* {@inheritdoc}
*/
protected function getUserByToken($token)
{
$response = $this->getHttpClient()->get('https://a.wunderlist.com/api/v1/users', [
'X-Access-Token: ' . $token . ' X-Client-ID: ' . $this->clientId
]);
return json_decode($response->getBody(), true);
}
I get the following error:
InvalidArgumentException in MessageFactory.php line 202:
allow_redirects must be true, false, or array
Do i miss things in the options array?
Jos
Actually socialite is not supposed to do something like this. But instead you may use Guzzle. There is a good video at laracasts. Just search for
Easy HTTP Requests. And here's the code that you may use for guzzle:Just read the docs here.