def get_collection_objects(
        self, headers: Dict[str, str], collection: str, params: Dict[str, Any]
    ) -> List[Dict[str, Any]]:
        """
        Fetches objects from a TAXII collection, handling pagination and token expiration.

        Args:
            headers (Dict[str, str]): HTTP headers, including authentication tokens.
            collection (str): The TAXII collection ID.
            params (Dict[str, Any]): Query parameters for filtering results.

        Returns:
            List[Dict[str, Any]]: A list of objects retrieved from the collection.
        """

        parameters = params.copy()
        collection_objects = []

        while True:
            # Send a request to fetch objects from the collection
            resp = requests.get(
                f"{self.base_url}/externalApi/taxii/collections/{collection}/objects/",
                params=parameters,
                headers=headers,
                timeout=TIMEOUT,
            )
            if resp.status_code == 401:
                logging.info(
                    "Access token has expired, status_code=%s and response=%s,"
                    " Regenerating token...",
                    resp.status_code,
                    resp.text,
                )

                access_token, _ = self.access_token()
                headers = {"Authorization": f"Bearer {access_token}"}
                continue

            # Process the response when it is successful (status code 200)
            if resp.status_code == 200:
                response_json = resp.json()
                all_objects = response_json.get("objects", [])
                collection_objects.extend(all_objects)
                logging.info(
                    "Fetched objects from collection: %s", len(collection_objects)
                )

                # Check if there is a "next" page of objects and update the params
                if "next" in response_json:
                    parameters["next"] = response_json["next"]
                else:
                    break
            else:
                logging.info(
                    "Error occurred while fetching objects from collection %s:"
                    " status_code=%s and response=%s",
                    collection,
                    resp.status_code,
                    resp.text,
                )
                break

        logging.info("Fetched all objects from collection: %s", collection)

        return collection_objects

        Fetches objects from a TAXII collection, handling pagination and token expiration.

        Args:
            headers (Dict[str, str]): HTTP headers, including authentication tokens.
            collection (str): The TAXII collection ID.
            params (Dict[str, Any]): Query parameters for filtering results.

        Returns:
            List[Dict[str, Any]]: A list of objects retrieved from the collection.
        
Solutions/CognyteLuminar/Data Connectors/CognyteLuminar/main.py