diff --git a/lightdash/client.py b/lightdash/client.py index 2e44768..09d65a2 100644 --- a/lightdash/client.py +++ b/lightdash/client.py @@ -33,6 +33,7 @@ def __init__(self, instance_url: str, access_token: str, project_uuid: str, conf self.instance_url = instance_url.rstrip('/') self.access_token = access_token self.project_uuid = project_uuid + self.auth_header = "Bearer" if access_token.startswith("ldsvc_") else "ApiKey" # Extract config values with defaults config = config or {} @@ -88,7 +89,7 @@ def _make_request( with httpx.Client( headers={ - "Authorization": f"ApiKey {self.access_token}", + "Authorization": f"{self.auth_header} {self.access_token}", "Accept": "application/json", }, timeout=self.timeout