53 'username' => $userName,
54 'password' => $password,
57 'form_params' => $data,
58 'auth' => [$this->credentials->getClientId(), $this->credentials->getClientSecret()],
61 $result = $this->client->post($this->accessTokenUrl, $options);
64 $body = json_decode((
string) $result->getBody(),
true);
66 (
string) $body[self::ACCESS_TOKEN],
67 (
int) $body[self::EXPIRES_IN],
68 (
string) $body[self::REFRESH_TOKEN]
71 $this->tokenStorage->setAccessToken($token->getValue());
72 $this->tokenStorage->setRefreshToken($token->getRefreshToken());