Skip to content

Commit 0a4eb8a

Browse files
Merge pull request #35654 from David-Engel/patch-1
Deprecate ActiveDirectoryPassword in drivers
2 parents 6abbca3 + 955004b commit 0a4eb8a

14 files changed

Lines changed: 94 additions & 55 deletions

docs/connect/ado-net/sql/azure-active-directory-authentication.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Describes how to use supported Microsoft Entra authentication modes
44
author: David-Engel
55
ms.author: davidengel
66
ms.reviewer: davidengel
7-
ms.date: 06/09/2025
7+
ms.date: 01/16/2026
88
ms.service: sql
99
ms.subservice: connectivity
1010
ms.topic: integration
@@ -28,7 +28,7 @@ Microsoft Entra authentication uses identities in Microsoft Entra ID to access d
2828

2929
When you set the `Authentication` connection property in the connection string, the client can choose a preferred Microsoft Entra authentication mode according to the value provided:
3030

31-
- The earliest **Microsoft.Data.SqlClient** version supports `Active Directory Password` for .NET Framework, .NET Core, and .NET Standard. It also supports `Active Directory Integrated` authentication and `Active Directory Interactive` authentication for .NET Framework.
31+
- The earliest **Microsoft.Data.SqlClient** version supports `Active Directory Password` [DEPRECATED] for .NET Framework, .NET Core, and .NET Standard. It also supports `Active Directory Integrated` authentication and `Active Directory Interactive` authentication for .NET Framework.
3232
- Starting with **Microsoft.Data.SqlClient** 2.0.0, support for `Active Directory Integrated` authentication and `Active Directory Interactive` authentication is extended across .NET Framework, .NET Core, and .NET Standard.
3333

3434
A new `Active Directory Service Principal` authentication mode is also added in SqlClient 2.0.0. It makes use of the client ID and secret of a service principal identity to accomplish authentication.
@@ -44,19 +44,21 @@ When the application is connecting to Azure SQL data sources by using Microsoft
4444

4545
| Value | Description | Microsoft.Data.SqlClient version |
4646
|:--|:--|:--:|
47-
| Active Directory Password | Authenticate with a Microsoft Entra identity's username and password | 1.0+ |
4847
| Active Directory Integrated | Authenticate with a Microsoft Entra identity by using Integrated Windows Authentication (IWA) | 2.0.0+<sup>1</sup> |
4948
| Active Directory Interactive | Authenticate with a Microsoft Entra identity by using interactive authentication | 2.0.0+<sup>1</sup> |
5049
| Active Directory Service Principal | Authenticate with a Microsoft Entra service principal, using its client ID and secret | 2.0.0+ |
5150
| Active Directory Device Code Flow | Authenticate with a Microsoft Entra identity by using Device Code Flow mode | 2.1.0+ |
5251
| Active Directory Managed Identity, <br>Active Directory MSI | Authenticate using a Microsoft Entra system-assigned or user-assigned managed identity | 2.1.0+ |
5352
| Active Directory Default | Authenticate with a Microsoft Entra identity by using password-less and non-interactive mechanisms including managed identities, Visual Studio Code, Visual Studio, Azure CLI, etc. | 3.0.0+ |
5453
| Active Directory Workload Identity | Authenticate with a Microsoft Entra identity by using a federated User Assigned Managed Identity to connect to SQL Database from Azure client environments that are enabled for Workload Identity. | 5.2.0+ |
54+
| Active Directory Password [DEPRECATED] | Authenticate with a Microsoft Entra identity's username and password.<br/><br/>Active Directory Password is deprecated. For more information, see [Using password authentication](#using-password-authentication). | 1.0+ |
5555

5656
<sup>1</sup> Before **Microsoft.Data.SqlClient** 2.0.0, `Active Directory Integrated`, and `Active Directory Interactive` authentication modes are supported only on .NET Framework.
5757

5858
## Using password authentication
5959

60+
[!INCLUDE [entra-password-auth-deprecation](../../../includes/entra-password-auth-deprecation.md)]
61+
6062
`Active Directory Password` authentication mode supports authentication to Azure data sources with Microsoft Entra ID for native or federated Microsoft Entra users. When you're using this mode, user credentials must be provided in the connection string. The following example shows how to use `Active Directory Password` authentication.
6163

6264
```csharp
@@ -332,7 +334,7 @@ The following example displays how to use a custom callback when `Active Directo
332334

333335
[!code-csharp [AADAuthenticationCustomDeviceFlowCallback#1](~/../sqlclient/doc/samples/AADAuthenticationCustomDeviceFlowCallback.cs#1)]
334336

335-
With a customized `ActiveDirectoryAuthenticationProvider` class, a user-defined application client ID can be passed to SqlClient when a supported Microsoft Entra authentication mode is in use. Supported Microsoft Entra authentication modes include `Active Directory Password`, `Active Directory Integrated`, `Active Directory Interactive`, `Active Directory Service Principal`, and `Active Directory Device Code Flow`.
337+
With a customized `ActiveDirectoryAuthenticationProvider` class, a user-defined application client ID can be passed to SqlClient when a supported Microsoft Entra authentication mode is in use. Supported Microsoft Entra authentication modes include `Active Directory Integrated`, `Active Directory Interactive`, `Active Directory Service Principal`, `Active Directory Device Code Flow`, and `Active Directory Password` [DEPRECATED].
336338

337339
The application client ID is also configurable via `SqlAuthenticationProviderConfigurationSection` or `SqlClientAuthenticationProviderConfigurationSection`. The configuration property `applicationClientId` applies to .NET Framework 4.6+ and .NET Core 2.1+.
338340

docs/connect/jdbc/connecting-using-azure-active-directory-authentication.md

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Connect using Microsoft Entra authentication
33
description: Learn how to develop Java applications that use the Microsoft Entra authentication feature with the Microsoft JDBC Driver for SQL Server.
44
author: David-Engel
55
ms.author: davidengel
6-
ms.date: 03/17/2025
6+
ms.date: 01/16/2026
77
ms.service: sql
88
ms.subservice: connectivity
99
ms.topic: integration
@@ -17,7 +17,6 @@ This article provides information on how to develop Java applications that use t
1717

1818
You can use Microsoft Entra authentication, which is a mechanism to connect to Azure SQL Database, Azure SQL Manged Instance, and Azure Synapse Analytics using identities in Microsoft Entra ID. Use Microsoft Entra authentication to centrally manage identities of database users and as an alternative to SQL Server authentication. The JDBC driver allows you to specify your Microsoft Entra credentials in the JDBC connection string to connect to Azure SQL. For information on how to configure Microsoft Entra authentication visit [Connecting to Azure SQL By Using Microsoft Entra authentication](/azure/azure-sql/database/authentication-aad-overview).
1919

20-
2120
Connection properties to support Microsoft Entra authentication in the Microsoft JDBC Driver for SQL Server are:
2221

2322
- **authentication**: Use this property to indicate which SQL authentication method to use for the connection.
@@ -30,9 +29,6 @@ Connection properties to support Microsoft Entra authentication in the Microsoft
3029
- **ActiveDirectoryIntegrated**
3130
- Since driver version 6.0, `authentication=ActiveDirectoryIntegrated` can be used to connect to Azure SQL/Synapse Analytics via integrated authentication. To use this authentication mode, you must [federate](/azure/active-directory/hybrid/connect/whatis-fed) the on-premises Active Directory Federation Services (ADFS) with Microsoft Entra ID in the cloud. Once you set it up, you can connect by either adding the native library `mssql-jdbc_auth-<version>-<arch>.dll` to the application class path on Windows, or by setting up a Kerberos ticket for cross-platform authentication support. You're able to access Azure SQL/Azure Synapse Analytics without being prompted for credentials when you're logged in to a domain-joined machine. For more information, see [Connect using ActiveDirectoryIntegrated authentication mode](#connect-using-activedirectoryintegrated-authentication-mode).
3231

33-
- **ActiveDirectoryPassword**
34-
- Since driver version 6.0, `authentication=ActiveDirectoryPassword` can be used to connect to Azure SQL/Synapse Analytics with Microsoft Entra username and password. For more information, see [Connect using ActiveDirectoryPassword authentication mode](#connect-using-activedirectorypassword-authentication-mode).
35-
3632
- **ActiveDirectoryInteractive**
3733
- Since driver version 9.2, `authentication=ActiveDirectoryInteractive` can be used to connect to an Azure SQL/Synapse Analytics via interactive authentication flow (multifactor authentication). For more information, see [Connect using ActiveDirectoryInteractive authentication mode](#connect-using-activedirectoryinteractive-authentication-mode).
3834

@@ -41,10 +37,14 @@ Connection properties to support Microsoft Entra authentication in the Microsoft
4137

4238
- **ActiveDirectoryServicePrincipalCertificate**
4339
- Since driver version 12.4, `authentication=ActiveDirectoryServicePrincipalCertificate` can be used to connect to an Azure SQL Database/Synapse Analytics by specifying the application/client ID in the userName property and the location of the Service Principal certificate in the `clientCertificate` property. For more information, see [Connect using ActiveDirectoryServicePrincipalCertificate authentication mode](#connect-using-activedirectoryserviceprincipalcertificate-authentication-mode).
40+
- **ActiveDirectoryPassword [DEPRECATED]**
41+
- ActiveDirectoryPassword is deprecated. For more information, see [Connect using ActiveDirectoryPassword authentication mode](#connect-using-activedirectorypassword-authentication-mode).
42+
- Since driver version 6.0, `authentication=ActiveDirectoryPassword` can be used to connect to Azure SQL/Synapse Analytics with Microsoft Entra username and password. For more information, see [Connect using ActiveDirectoryPassword authentication mode](#connect-using-activedirectorypassword-authentication-mode).
43+
4444
- **SqlPassword**
4545
- Use `authentication=SqlPassword` to connect to a SQL Server using userName/user and password properties.
4646
- **NotSpecified**
47-
- Use `authentication=NotSpecified` or leave it as the default when none of these authentication methods are needed.
47+
- The default value when none of these authentication methods are specified.
4848
- **accessToken**: Use this connection property to connect to a SQL Database with access token. `accessToken` can only be set using the Properties parameter of the `getConnection()` method in the DriverManager class. It can't be used in the connection URL.
4949

5050
For more information, see the authentication property on the [Setting the Connection Properties](setting-the-connection-properties.md) page.
@@ -289,7 +289,7 @@ You have successfully logged on as: <your domain user name>
289289
290290
### Set Kerberos ticket on Windows, Linux And macOS
291291
292-
You must up a Kerberos ticket to link your current user to a Windows domain account. Following is a summary of the key steps.
292+
You must set up a Kerberos ticket to link your current user to a Windows domain account. Following is a summary of the key steps.
293293
294294
#### Windows
295295
@@ -359,6 +359,8 @@ Access to a Windows domain-joined machine to query your Kerberos Domain Controll
359359
360360
## Connect using ActiveDirectoryPassword authentication mode
361361
362+
[!INCLUDE [entra-password-auth-deprecation](../../includes/entra-password-auth-deprecation.md)]
363+
362364
The following example shows how to use `authentication=ActiveDirectoryPassword` mode.
363365
364366
To build and run the example:
@@ -415,7 +417,6 @@ If the connection is established, you should see the following message as output
415417
You have successfully logged on as: <your user name>
416418
```
417419
418-
419420
## Connect using ActiveDirectoryInteractive authentication mode
420421
421422
The following example shows how to use `authentication=ActiveDirectoryInteractive` mode.
@@ -612,12 +613,10 @@ If a connection is established, you should see the following message as output:
612613
You have successfully logged on as: <your app/client ID>
613614
```
614615
615-
616616
## Connect using access token
617617
618618
Applications/services can retrieve an access token from Microsoft Entra ID and use that to connect to Azure SQL Database, Azure SQL Managed Instance, and Azure Synapse Analytics.
619619
620-
621620
> [!NOTE]
622621
> `accessToken` can only be set using the Properties parameter of the `getConnection()` method in the DriverManager class. It can't be used in the connection string. Starting with driver version 12.2, users can implement and provide an `accessToken` callback to the driver for token renewal in connection pooling scenarios. Connection pooling scenarios require the connection pool implementation to use the standard [JDBC connection pooling classes](using-connection-pooling.md).
623622
@@ -633,16 +632,15 @@ To build and run the example:
633632
5. Enter `mytokentest` as a friendly name for the application.
634633
6. Leave the default selection for supported account types, which can use the application.
635634
7. Select **Register** at the bottom.
636-
6. Don't need SIGN-ON URL. Provide anything: `https://mytokentest`.
637-
7. Select `Create` at the bottom.
638-
8. Upon selecting **Register**, the app is immediately created, and you're taken to its resource page.
639-
9. In the **Essentials** box, find the **Application (client) ID** and copy it. You need this value later to configure your application.
640-
10. Select **Certificates & secrets** from the navigation pane. On the **Client secrets (0)** tab, select **New client secret**. Enter a description for the secret and select an expiration (the default is fine). Select **Add** at the bottom. **Important** before leaving this page, copy the generated **Value** for your client secret. This value can't be viewed after leaving the page. This value is the client secret.
641-
11. Return to the [App registrations](https://ms.portal.azure.com/#view/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/~/RegisteredApps) pane for Microsoft Entra ID and find the **Endpoints** tab. Copy the URL under `OAuth 2.0 token endpoint`. This URL is your STS URL.
635+
8. Don't need SIGN-ON URL. Provide anything: `https://mytokentest`.
636+
9. Select `Create` at the bottom.
637+
10. Upon selecting **Register**, the app is immediately created, and you're taken to its resource page.
638+
11. In the **Essentials** box, find the **Application (client) ID** and copy it. You need this value later to configure your application.
639+
12. Select **Certificates & secrets** from the navigation pane. On the **Client secrets (0)** tab, select **New client secret**. Enter a description for the secret and select an expiration (the default is fine). Select **Add** at the bottom. **Important** before leaving this page, copy the generated **Value** for your client secret. This value can't be viewed after leaving the page. This value is the client secret.
640+
13. Return to the [App registrations](https://ms.portal.azure.com/#view/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/~/RegisteredApps) pane for Microsoft Entra ID and find the **Endpoints** tab. Copy the URL under `OAuth 2.0 token endpoint`. This URL is your STS URL.
642641
643642
1. Connect to your database as a Microsoft Entra admin and use a T-SQL command to provision a contained database user for your application principal. For more information on how to create a Microsoft Entra admin and a contained database user, see the [Connecting by using Microsoft Entra authentication](/azure/azure-sql/database/authentication-aad-overview).
644643
645-
646644
```sql
647645
CREATE USER [mytokentest] FROM EXTERNAL PROVIDER
648646
```

0 commit comments

Comments
 (0)