@@ -380,11 +380,11 @@ def from_token_guid(
380380 :returns: a new client instance authenticated with the resolved token
381381 :raises: ErrorCode.UNABLE_TO_ESCALATE_WITH_PARAM: If any step in the token resolution fails
382382 """
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" )
384384
385385 # Step 1: Initialize base client and get Atlan-Argo credentials
386386 # 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 = "" )
388388 client_info = client .impersonate ._get_client_info (
389389 client_id = client_id , client_secret = client_secret
390390 )
@@ -401,7 +401,7 @@ def from_token_guid(
401401 try :
402402 raw_json = client ._call_api (GET_TOKEN , request_obj = argo_credentials )
403403 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 )
405405 except AtlanError as atlan_err :
406406 raise ErrorCode .UNABLE_TO_ESCALATE_WITH_PARAM .exception_with_parameters (
407407 "Failed to obtain Atlan-Argo token"
@@ -427,7 +427,7 @@ def from_token_guid(
427427 token_api_key = AccessTokenResponse (** raw_json ).access_token
428428
429429 # 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 )
431431 except AtlanError as atlan_err :
432432 raise ErrorCode .UNABLE_TO_ESCALATE_WITH_PARAM .exception_with_parameters (
433433 "Failed to obtain access token for API token"
0 commit comments