Skip to content

Commit cd436a8

Browse files
committed
Allow Trusted connection parameter oveririding
Trusted connection parameter is automatically set to yes which causes authentication failure when a different authentication method is used. e.g. when using managed identities with azure sql and authentication as ActiveDirectoryMsi
1 parent bcf3527 commit cd436a8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mssql/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ def get_new_connection(self, conn_params):
249249
user = conn_params.get('USER', None)
250250
password = conn_params.get('PASSWORD', None)
251251
port = conn_params.get('PORT', None)
252+
trusted_connection = conn_params.get('Trusted_Connection', 'yes')
252253

253254
options = conn_params.get('OPTIONS', {})
254255
driver = options.get('driver', 'ODBC Driver 13 for SQL Server')
@@ -289,7 +290,7 @@ def get_new_connection(self, conn_params):
289290
cstr_parts['PWD'] = password
290291
else:
291292
if ms_drivers.match(driver):
292-
cstr_parts['Trusted_Connection'] = 'yes'
293+
cstr_parts['Trusted_Connection'] = trusted_connection
293294
else:
294295
cstr_parts['Integrated Security'] = 'SSPI'
295296

0 commit comments

Comments
 (0)