Skip to content

Commit 472209c

Browse files
committed
Change oauth redirect port range to port
Signed-off-by: Jacky Hu <[email protected]>
1 parent 8fa4415 commit 472209c

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/databricks/sql/auth/auth.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,9 @@ def get_python_sql_connector_auth_provider(hostname: str, **kwargs):
9090
tls_client_cert_file=kwargs.get("_tls_client_cert_file"),
9191
oauth_scopes=PYSQL_OAUTH_SCOPES,
9292
oauth_client_id=kwargs.get("oauth_client_id") or PYSQL_OAUTH_CLIENT_ID,
93-
oauth_redirect_port_range=kwargs.get("oauth_redirect_port_range") if kwargs.get(
94-
"oauth_client_id") else PYSQL_OAUTH_REDIRECT_PORT_RANGE,
93+
oauth_redirect_port_range=[kwargs.get("oauth_redirect_port")]
94+
if kwargs.get("oauth_client_id")
95+
else PYSQL_OAUTH_REDIRECT_PORT_RANGE,
9596
oauth_persistence=kwargs.get("experimental_oauth_persistence"),
9697
)
9798
return get_auth_provider(cfg)

src/databricks/sql/client.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,11 @@ def __init__(
6161
Note this is beta (private preview)
6262
6363
oauth_client_id: `str`, optional
64-
custom oauth client_id. If not specified, it will use the client_id of databricks-sql-python
64+
custom oauth client_id. If not specified, it will use the built-in client_id of databricks-sql-python.
6565
66-
oauth_redirect_port_range: `List[str]`, optional
67-
oauth redirect port range. This is required when custom oauth client_id `oauth_client_id` is set
66+
oauth_redirect_port: `int`, optional
67+
port of the oauth redirect uri (localhost). This is required when custom oauth client_id
68+
`oauth_client_id` is set
6869
6970
experimental_oauth_persistence: configures preferred storage for persisting oauth tokens.
7071
This has to be a class implementing `OAuthPersistence`.

0 commit comments

Comments
 (0)