public function authenticate(string $username, string $password, ?string $scope = '*'): Response
    {
        $body = $this->mergeApiBody(
            \array_filter(\compact('username', 'password', 'scope'))
        );

        return $this->send('POST', 'oauth/token', $this->getApiHeaders(), $body)
                    ->validateWith(function ($statusCode, $response) {
                        if ($statusCode !== 200) {
                            throw new RuntimeException('Unable to generate access token!');
                        }

                        $this->client->setAccessToken($response->toArray()['access_token']);
                    });
    }