Hari Haran R
07/17/2025, 2:04 PMkapa.ai
07/17/2025, 2:04 PMHttpAuthenticator. In this class, you can implement logic to log in and obtain a new cookie whenever needed. The knowledge sources provide an example of such an authenticator. You would typically: 1. Implement a login method that sends a POST request with credentials to obtain a new cookie. 2. Store the cookie in your authenticator instance. 3. Implement logic in your authenticator to detect when the cookie is expired and re-authenticate as needed. Here’s a simplified example from the knowledge sources: python class CookieAuthenticator(HttpAuthenticator): def __init__(self, config): self.cookie_jar = self.login(config["api_key"], config["username"], config["password"]) def login(self, api_key, username, password): # ...obfuscate API key and prepare login body... login_url = urljoin(self.url_base, "authenticatedSession") resp = requests.post(url=login_url, json=login_body) resp.raise_for_status() return resp.cookies def get_auth_header(self) -> Mapping[str, Any]: # Return the cookie header for requests return {"cookie": "; ".join([f"{k}={v}" for k, v in requests.utils.dict_from_cookiejar(self.cookie_jar).items()])} To refresh the cookie when expired, you would need to add logic in your authenticator to check if the cookie is still valid before each request, and if not, call login again to get a new cookie. You will then pass this authenticator to your stream classes. This approach keeps authentication concerns separate and follows Airbyte CDK practices. For more details, see the official answer in the forum post: [Is there any way to do Cookie-based authentication with Airbyte?](https://discuss.airbyte.io/t/549)<source>https://discuss.airbyte.io/t/549</source>. If you need to detect cookie expiration, you may need to track the cookie's expiry time (if provided by the API) or handle 401/403 responses by triggering a re-login. The knowledge sources do not provide a built-in mechanism for automatic cookie refresh, so this logic must be implemented in your custom authenticator.Hari Haran R
07/17/2025, 2:05 PMkapa.ai
07/17/2025, 2:05 PMkapa.ai
07/17/2025, 2:06 PMHari Haran R
07/17/2025, 2:25 PMkapa.ai
07/17/2025, 2:25 PMkapa.ai
07/17/2025, 2:25 PM