public function getAccessToken(): ApiAccessToken
    {
        try {
            $accessToken = $this->tokenStorage->getAccessToken();
        } catch (UnableToAcquireAccessToken $e) {
            $accessToken = null;
        }

        if ($accessToken && $accessToken->isExpired()) {
            $this->tokenStorage->unsetAccessToken();
            $accessToken = null;
        }

        return $accessToken ?: $this->refreshToken();
    }