@@ -14,7 +14,7 @@ class AuthType(Enum):
1414DATABRICKS_OAUTH = "databricks-oauth"
1515AZURE_OAUTH = "azure-oauth"
1616# TODO: Token federation should be a feature that works with different auth types,
17- # not an auth type itself. This will be refactored in a futurerelease .
17+ # not an auth type itself. This will be refactored in a futurechange .
1818TOKEN_FEDERATION = "token-federation"
1919# other supported types (access_token) can be inferred
2020# we can add more types as needed later
@@ -68,19 +68,10 @@ def get_auth_provider(cfg: ClientContext):
6868 )
6969return ExternalAuthProvider (federation_provider )
7070
71- # If access token is provided with token federation, create a SimpleCredentialsProvider
72- elif cfg .auth_type == AuthType .TOKEN_FEDERATION .value and cfg .access_token :
73- from databricks .sql .auth .token_federation import (
74- create_token_federation_provider ,
75- )
76-
77- federation_provider = create_token_federation_provider (
78- cfg .access_token ,cfg .hostname ,cfg .identity_federation_client_id
79- )
80- return ExternalAuthProvider (federation_provider )
81-
71+ # If not token federation, just use the credentials provider directly
8272return ExternalAuthProvider (cfg .credentials_provider )
8373
74+ # If we don't have a credentials provider but have token federation auth type with access token
8475if cfg .auth_type == AuthType .TOKEN_FEDERATION .value and cfg .access_token :
8576# If only access_token is provided with token federation, use create_token_federation_provider
8677from databricks .sql .auth .token_federation import (