mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-08 09:38:25 -05:00
Introduce AAD interactive auth mode (#1860)
This commit is contained in:
@@ -17,6 +17,7 @@ using Microsoft.SqlTools.ServiceLayer.Connection;
|
||||
using Microsoft.SqlTools.ServiceLayer.DacFx.Contracts;
|
||||
using Microsoft.SqlTools.ServiceLayer.SchemaCompare.Contracts;
|
||||
using Microsoft.SqlTools.ServiceLayer.Utility;
|
||||
using static Microsoft.SqlTools.Shared.Utility.Constants;
|
||||
using Microsoft.SqlTools.Utility;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.SchemaCompare
|
||||
@@ -187,7 +188,9 @@ namespace Microsoft.SqlTools.ServiceLayer.SchemaCompare
|
||||
case SchemaCompareEndpointType.Database:
|
||||
{
|
||||
string connectionString = GetConnectionString(connInfo, endpointInfo.DatabaseName);
|
||||
return connInfo.ConnectionDetails?.AzureAccountToken != null
|
||||
|
||||
// Set Access Token only when authentication mode is not specified.
|
||||
return connInfo.ConnectionDetails?.AzureAccountToken != null && connInfo.ConnectionDetails.AuthenticationType == AzureMFA
|
||||
? new SchemaCompareDatabaseEndpoint(connectionString, new AccessTokenProvider(connInfo.ConnectionDetails.AzureAccountToken))
|
||||
: new SchemaCompareDatabaseEndpoint(connectionString);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user