Add 'Active Directory Default' authentication support

Issue #246
This commit is contained in:
Bill Pieper 2024-02-02 08:32:41 -06:00
Родитель 9a646aa0e4
Коммит aec290bcff
2 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -38,6 +38,7 @@ namespace Microsoft.Azure.SqlDatabase.ElasticScale.ShardManagement
/// SqlAuthenticationMethod.ActiveDirectoryInteractive.ToString() cannot be used
/// because it may not be available in the .NET framework version that we are running in
/// </summary>
internal static readonly string ActiveDirectoryDefaultStr = "ActiveDirectoryDefault";
internal static readonly string ActiveDirectoryInteractiveStr = "ActiveDirectoryInteractive";
internal static readonly string ActiveDirectoryServicePrincipal = "ActiveDirectoryServicePrincipal";
internal static readonly string ActiveDirectoryDeviceCodeFlow = "ActiveDirectoryDeviceCodeFlow";

Просмотреть файл

@ -161,7 +161,8 @@ namespace Microsoft.Azure.SqlDatabase.ElasticScale.ShardManagement
if (connectionString.ContainsKey(ShardMapUtils.Authentication))
{
string authentication = connectionString[ShardMapUtils.Authentication].ToString();
if (authentication.Equals(ShardMapUtils.ActiveDirectoryIntegratedStr, StringComparison.OrdinalIgnoreCase)
if ( authentication.Equals(ShardMapUtils.ActiveDirectoryDefaultStr, StringComparison.OrdinalIgnoreCase)
|| authentication.Equals(ShardMapUtils.ActiveDirectoryIntegratedStr, StringComparison.OrdinalIgnoreCase)
|| authentication.Equals(ShardMapUtils.ActiveDirectoryInteractiveStr, StringComparison.OrdinalIgnoreCase)
|| authentication.Equals(ShardMapUtils.ActiveDirectoryManagedIdentity, StringComparison.OrdinalIgnoreCase)
|| authentication.Equals(ShardMapUtils.ActiveDirectoryServicePrincipal, StringComparison.OrdinalIgnoreCase)