Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4bf2a4e

Browse files
jahnvi480Jahnvi Thakkar
and
Jahnvi Thakkar
authored
FIX: Interactive on Windows (#142)
### ADO Work Item Reference <!-- Insert your ADO Work Item ID below (e.g. AB#37452) -->>[AB#38007](https://sqlclientdrivers.visualstudio.com/c6d89619-62de-46a0-8b46-70b92a84d85e/_workitems/edit/38007)-------------------------------------------------------------------### Summary This pull request includes a small change to the`process_auth_parameters` function in `mssql_python/auth.py`. The changeadjusts how the `auth_type` is handled for interactive authentication onWindows, ensuring compatibility with native handling of AADInteractive.---------Co-authored-by: Jahnvi Thakkar <jathakkar@microsoft.com>
1 parent919c230 commit4bf2a4e

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

‎mssql_python/auth.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,11 @@ def process_auth_parameters(parameters: list) -> Tuple[list, Optional[str]]:
8484
ifkey_lower=="authentication":
8585
# Check for supported authentication types and set auth_type accordingly
8686
ifvalue_lower==AuthType.INTERACTIVE.value:
87+
auth_type="interactive"
8788
# Interactive authentication (browser-based); only append parameter for non-Windows
8889
ifplatform.system().lower()=="windows":
89-
continue# Skip adding this parameter for Windows
90-
auth_type="interactive"
90+
auth_type=None# Let Windows handle AADInteractive natively
91+
9192
elifvalue_lower==AuthType.DEVICE_CODE.value:
9293
# Device code authentication (for devices without browser)
9394
auth_type="devicecode"

‎tests/test_008_auth.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,24 +137,23 @@ def test_interactive_auth_windows(self, monkeypatch):
137137
monkeypatch.setattr(platform,"system",lambda:"Windows")
138138
params= ["Authentication=ActiveDirectoryInteractive","Server=test"]
139139
modified_params,auth_type=process_auth_parameters(params)
140-
assert"Authentication=ActiveDirectoryInteractive"notinmodified_params
140+
assert"Authentication=ActiveDirectoryInteractive"inmodified_params
141141
assertauth_type==None
142142

143143
deftest_interactive_auth_non_windows(self,monkeypatch):
144144
monkeypatch.setattr(platform,"system",lambda:"Darwin")
145145
params= ["Authentication=ActiveDirectoryInteractive","Server=test"]
146-
modified_params,auth_type=process_auth_parameters(params)
147-
assert"Authentication=ActiveDirectoryInteractive"inmodified_params
146+
_,auth_type=process_auth_parameters(params)
148147
assertauth_type=="interactive"
149148

150149
deftest_device_code_auth(self):
151150
params= ["Authentication=ActiveDirectoryDeviceCode","Server=test"]
152-
modified_params,auth_type=process_auth_parameters(params)
151+
_,auth_type=process_auth_parameters(params)
153152
assertauth_type=="devicecode"
154153

155154
deftest_default_auth(self):
156155
params= ["Authentication=ActiveDirectoryDefault","Server=test"]
157-
modified_params,auth_type=process_auth_parameters(params)
156+
_,auth_type=process_auth_parameters(params)
158157
assertauth_type=="default"
159158

160159
classTestRemoveSensitiveParams:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp