public function authenticate($username, $password)
    {
        $authRequest = new Request('GET', $this->userbaseUrl);
        $client = new GuzzleClient(
            [
                'verify' => $this->tlsCertVerification,
                'headers' => [
                    'User-Agent' => 'HubUserbaseClient (Guzzle)',
                ],
                'auth' => [$username, $password],
            ]
        );
        try {
            $response = $client->send($authRequest);
        } catch (BadResponseException $e) {
            $this->handleBadResponseException($e);
        } catch (GuzzleException $e) {
            throw new AuthenticationFailureException(
                null,
                "The authentication request failed unexpectedly.",
                null,
                $e
            );
        }
        $json = $this->getResponseData($response);
        if (!$json) {
            throw new AuthenticationFailureException(
                $response,
                "Authentication failed because the authentication request did not result in the expected response data."
            );
        }
        if (!isset($json['jwt'])) {
            throw new AuthenticationFailureException(
                $response,
                "Authentication failed because an authentication token was not obtained."
            );
        }
        return $json['jwt'];
    }