@@ -380,11 +380,11 @@ def from_token_guid(
380
380
:returns: a new client instance authenticated with the resolved token
381
381
:raises: ErrorCode.UNABLE_TO_ESCALATE_WITH_PARAM: If any step in the token resolution fails
382
382
"""
383
- base_url = base_url or os .environ .get ("ATLAN_BASE_URL" , "INTERNAL" )
383
+ final_base_url = base_url or os .environ .get ("ATLAN_BASE_URL" , "INTERNAL" )
384
384
385
385
# Step 1: Initialize base client and get Atlan-Argo credentials
386
386
# Note: Using empty api_key as we're bootstrapping authentication
387
- client = AtlanClient (base_url = base_url , api_key = "" )
387
+ client = AtlanClient (base_url = final_base_url , api_key = "" )
388
388
client_info = client .impersonate ._get_client_info (
389
389
client_id = client_id , client_secret = client_secret
390
390
)
@@ -401,7 +401,7 @@ def from_token_guid(
401
401
try :
402
402
raw_json = client ._call_api (GET_TOKEN , request_obj = argo_credentials )
403
403
argo_token = AccessTokenResponse (** raw_json ).access_token
404
- temp_argo_client = AtlanClient (base_url = base_url , api_key = argo_token )
404
+ temp_argo_client = AtlanClient (base_url = final_base_url , api_key = argo_token )
405
405
except AtlanError as atlan_err :
406
406
raise ErrorCode .UNABLE_TO_ESCALATE_WITH_PARAM .exception_with_parameters (
407
407
"Failed to obtain Atlan-Argo token"
@@ -427,7 +427,7 @@ def from_token_guid(
427
427
token_api_key = AccessTokenResponse (** raw_json ).access_token
428
428
429
429
# Step 5: Create and return the authenticated client
430
- return AtlanClient (base_url = base_url , api_key = token_api_key )
430
+ return AtlanClient (base_url = final_base_url , api_key = token_api_key )
431
431
except AtlanError as atlan_err :
432
432
raise ErrorCode .UNABLE_TO_ESCALATE_WITH_PARAM .exception_with_parameters (
433
433
"Failed to obtain access token for API token"
0 commit comments