Skip to content

Commit b41e8b4

Browse files
committed
Add docs and support for Azure AD Auth
In base.py, if the user would like to use interactive auth, then password is not needed.
1 parent 00bbdca commit b41e8b4

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Welcome to the MSSQL-Django 3rd party backend project!
44

55
*mssql-django* is a fork of [django-mssql-backend](https://pypi.org/project/django-mssql-backend/). This project provides an enterprise database connectivity option for the Django Web Framework, with support for Microsoft SQL Server and Azure SQL Database.
66

7-
We'd like to give thanks to the community that made this project possible, with particular recognition of the contributors: OskarPersson, michiya, dlo and the original Google Code django-pyodbc team. Moving forward we encourage partipation in this project from both old and new contributors!
7+
We'd like to give thanks to the community that made this project possible, with particular recognition of the contributors: OskarPersson, michiya, dlo and the original Google Code django-pyodbc team. Moving forward we encourage partipation in this project from both old and new contributors!
88

99
We hope you enjoy using the MSSQL-Django 3rd party backend.
1010

@@ -81,7 +81,7 @@ for any given database-level settings dictionary:
8181

8282
String. The name of database to use when running the test suite.
8383
If the default value (`None`) is used, the test database will use
84-
the name `"test\_" + NAME`.
84+
the name `"test_" + NAME`.
8585

8686
- COLLATION
8787

@@ -151,7 +151,7 @@ Dictionary. Current available keys are:
151151
- extra_params
152152

153153
String. Additional parameters for the ODBC connection. The format is
154-
``"param=value;param=value"``.
154+
``"param=value;param=value"``, [Azure AD Authentication](https://github.com/microsoft/mssql-django/wiki/Azure-AD-Authentication) can be added to this field.
155155

156156
- collation
157157

mssql/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,8 @@ def get_new_connection(self, conn_params):
286286

287287
if user:
288288
cstr_parts['UID'] = user
289-
cstr_parts['PWD'] = password
289+
if 'Authentication=ActiveDirectoryInteractive' not in options.get('extra_params', ''):
290+
cstr_parts['PWD'] = password
290291
else:
291292
if ms_drivers.match(driver):
292293
cstr_parts['Trusted_Connection'] = 'yes'

0 commit comments

Comments
 (0)