43 if (!is_null($this->credentials->getScope())) {
44 $data[
self::SCOPE] = $this->credentials->getScope();
47 'form_params' => $data,
48 'auth' => [$this->credentials->getClientId(), $this->credentials->getClientSecret()]
51 $result = $this->client->request(
"post", $this->accessTokenUrl, $options);
54 $body = json_decode((
string)$result->getBody(),
true);
55 return new TokenModel((
string)$body[self::ACCESS_TOKEN], (
int)$body[self::EXPIRES_IN]);