protected function authenticate($refresh = false)
    {
        $token = $refresh ? $this->refreshToken : $this->authToken ;

        $response = $this->client->get('authenticate', [
            'headers' => ['Authentication' => $token->getToken()],
        ]);

        // Parse the response body.
        $json = json_decode($response->getBody());
        $body = $json->{'nl.divide.iq'};
        $expire = new \DateTime($body->expiration_date, new \DateTimezone('UTC'));

        // Store the access and refresh (if any) tokens in the object.
        $this->accessToken = new Token($body->access_token, $expire);
        if (isset($body->refresh_token)) {
            $this->refreshToken = new Token($body->refresh_token);
        }

        return $this;
    }