Hello All,
I am trying to connect my UWP app to an azure sql database with mfa. I do not want to expose my username and password into the connection string and would like to keep it hidden.
I've attempted to use the ADInteractive class tutorial on the microsoft website but it didn't seem to work.
https://learn.microsoft.com/en-in/azure/sql-database/active-directory-interactive-connect-azure-sql-db
Also part of the issue may be because I've installed the nuget package (Microsoft.IdentityModel.Clients.ActiveDirectory) but it doesnt allow me to view it in object browser.
I have tried to clean/rebuild/build installed it several different ways with no luck.
I have also tried multiple target versions like Win10 1903/1809/1803...
Any help would be appreciated.
If I am doing something incorrectly or if its even possible to do what Im atempting.
using System;
// Reference to Azure AD authentication assembly
using Microsoft.IdentityModel.Clients.ActiveDirectory;
using DA = System.Data;
using SC = System.Data.SqlClient;
using AD = Microsoft.IdentityModel.Clients.ActiveDirectory;
using TX = System.Text;
using TT = System.Threading.Tasks;
namespace ADInteractive5
{
class Program
{
// ASSIGN YOUR VALUES TO THESE STATIC FIELDS !!
static public string Az_SQLDB_svrName = "";
static public string AzureAD_UserID = "";
static public string Initial_DatabaseName = "";
// Some scenarios do not need values for the following two fields:
static public readonly string ClientApplicationID = "";
static public readonly Uri RedirectUri = new Uri("");
public static void Main(string[] args)
{
var provider = new ActiveDirectoryAuthProvider();
**SC.SqlAuthenticationProvider**.SetProvider(**SC.SqlAuthenticationMethod**.ActiveDirectoryInteractive,provider);
Program.Connection();
}
I also can't go to the reference and it tells me it can't be viewed in the object browser.
also whatever is in bold is telling me that it doesn't exist in the namespace..