Skip to content

Commit b82fa01

Browse files
authored
Fixed OAuth M2M corner case in WorkspaceClient where DATABRICKS_ACCOUNT_ID is present in the environment (#273)
## Changes Also check for account client configuration when resolving OIDC endpoints. Now logic is the same as in Go SDK: https://github.com/databricks/databricks-sdk-go/blame/dd2802a246d8a2ac0689031cc93e15d97b486df8/config/auth_m2m.go#L45-L56 ## Tests Tested on a local change Signed-off-by: Serge Smertin <[email protected]>
1 parent 9dc991c commit b82fa01

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

databricks/sdk/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ def oidc_endpoints(self) -> Optional[OidcEndpoints]:
640640
return None
641641
return OidcEndpoints(authorization_endpoint=real_auth_url,
642642
token_endpoint=real_auth_url.replace('/authorize', '/token'))
643-
if self.account_id:
643+
if self.is_account_client and self.account_id:
644644
prefix = f'{self.host}/oidc/accounts/{self.account_id}'
645645
return OidcEndpoints(authorization_endpoint=f'{prefix}/v1/authorize',
646646
token_endpoint=f'{prefix}/v1/token')

0 commit comments

Comments
 (0)