Skip to content

Commit 1430e8a

Browse files
committed
tweak
1 parent a12726a commit 1430e8a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

databricks/sdk/credentials_provider.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,19 +201,20 @@ def external_browser(cfg: 'Config') -> Optional[CredentialsProvider]:
201201
# Load cached credentials from disk if they exist.
202202
# Note that these are local to the Python SDK and not reused by other SDKs.
203203
oidc_endpoints = cfg.oidc_endpoints
204+
redirect_url = 'http://localhost:8020'
204205
token_cache = TokenCache(host=cfg.host,
205206
oidc_endpoints=oidc_endpoints,
206207
client_id=client_id,
207208
client_secret=client_secret,
208-
redirect_url='http://localhost:8020')
209+
redirect_url=redirect_url)
209210
credentials = token_cache.load()
210211
if credentials:
211212
# Force a refresh in case the loaded credentials are expired.
212213
credentials.token()
213214
else:
214215
oauth_client = OAuthClient(oidc_endpoints=oidc_endpoints,
215216
client_id=client_id,
216-
redirect_url='http://localhost:8020',
217+
redirect_url=redirect_url,
217218
client_secret=client_secret)
218219
consent = oauth_client.initiate_consent()
219220
if not consent:

0 commit comments

Comments
 (0)