Skip to content
This repository has been archived by the owner on Jan 23, 2025. It is now read-only.

Commit

Permalink
Merge pull request #173 from Azure/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
xpouyat authored Dec 8, 2023
2 parents 54df288 + b2ab9c8 commit 6064c81
Show file tree
Hide file tree
Showing 24 changed files with 1,093 additions and 950 deletions.
11 changes: 8 additions & 3 deletions AMSExplorer.sln
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29215.179
# Visual Studio Version 17
VisualStudioVersion = 17.8.34316.72
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AMSExplorer", "AMSExplorer\AMSExplorer.csproj", "{67573AA5-0316-4C90-8CE4-93A950CD0A86}"
EndProject
Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "Setup", "Setup\Setup.vdproj", "{BA871D4E-EAAC-4CC7-8A5D-15F4B5B4BDB4}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A57C3173-7DA2-4A4A-A9EF-D3E688A16BD7}"
ProjectSection(SolutionItems) = preProject
README.md = README.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
CD_ROM|Any CPU = CD_ROM|Any CPU
Expand Down Expand Up @@ -37,7 +42,7 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EnterpriseLibraryConfigurationToolBinariesPath = packages\TransientFaultHandling.Core.5.1.1209.1\lib\NET4
SolutionGuid = {56028331-830B-4377-8919-694B44B54A0F}
EnterpriseLibraryConfigurationToolBinariesPath = packages\TransientFaultHandling.Core.5.1.1209.1\lib\NET4
EndGlobalSection
EndGlobal
25 changes: 13 additions & 12 deletions AMSExplorer/AMSClient/AMSClientV3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public AMSClientV3(AzureEnvironment myEnvironment, string azureSubscriptionId, C
_appInteract = PublicClientApplicationBuilder.Create(environment.ClientApplicationId)

//.WithAuthority(AzureCloudInstance.AzurePublic, credentialsEntry.AadTenantId)
.WithAuthority(environment.AADSettings.AuthenticationEndpoint + string.Format("{0}", credentialsEntry.AadTenantId ?? "common"))
.WithAuthority(environment.AADSettings.AuthenticationEndpoint + string.Format("{0}", credentialsEntry.AadTenantId ?? "organizations"))
.WithDefaultRedirectUri()
//.WithRedirectUri("http://localhost")
.WithBroker(true)
Expand All @@ -70,7 +70,7 @@ public AMSClientV3(AzureEnvironment myEnvironment, string azureSubscriptionId, C
{
_appSP = ConfidentialClientApplicationBuilder.Create(credentialsEntry.ADSPClientId)
.WithClientSecret(credentialsEntry.ClearADSPClientSecret)
.WithAuthority(environment.AADSettings.AuthenticationEndpoint + string.Format("{0}", credentialsEntry.AadTenantId ?? "common"), true)
.WithAuthority(environment.AADSettings.AuthenticationEndpoint + string.Format("{0}", credentialsEntry.AadTenantId ?? "organizations"), true)
.Build();
}

Expand Down Expand Up @@ -105,13 +105,12 @@ private async void OnTimedEventAuthRefresh(object sender, ElapsedEventArgs e)
}


public async Task<MediaServicesAccountResource> ConnectAndGetNewClientV3Async(Form callerForm = null)
public async Task<MediaServicesAccountResource> ConnectAndGetNewClientV3Async(Form callerForm = null, bool connectToMKIO = true)
{
if (!credentialsEntry.UseSPAuth)
{
var accounts = await _appInteract.GetAccountsAsync();


try
{
authResult = await _appInteract.AcquireTokenSilent(scopes, accounts.FirstOrDefault()).ExecuteAsync().ConfigureAwait(false);
Expand Down Expand Up @@ -179,15 +178,17 @@ public async Task<MediaServicesAccountResource> ConnectAndGetNewClientV3Async(Fo

}


// form for MK/IO
MKIOConnection mkioConnectionForm = new(credentialsEntry.MKIOSubscriptionName, credentialsEntry.MKIOClearToken);

if (mkioConnectionForm.ShowDialog() == DialogResult.OK)
if (firstTimeAuth && connectToMKIO)
{
useMKIOConnection = true;
credentialsEntry.MKIOSubscriptionName = mkioConnectionForm.MKIOSubscriptionName;
credentialsEntry.MKIOClearToken = mkioConnectionForm.MKIOToken;
// form for MK/IO
MKIOConnection mkioConnectionForm = new(credentialsEntry.MKIOSubscriptionName, credentialsEntry.MKIOClearToken);

if (mkioConnectionForm.ShowDialog() == DialogResult.OK)
{
useMKIOConnection = true;
credentialsEntry.MKIOSubscriptionName = mkioConnectionForm.MKIOSubscriptionName;
credentialsEntry.MKIOClearToken = mkioConnectionForm.MKIOToken;
}
}

credentials = new TokenCredentials(authResult.AccessToken, "Bearer");
Expand Down
14 changes: 7 additions & 7 deletions AMSExplorer/AMSExplorer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<Description></Description>
<Copyright>Copyright © 2023</Copyright>
<Company>$(Authors)Microsoft</Company>
<AssemblyVersion>5.8.0.0</AssemblyVersion>
<FileVersion>5.8.0.0</FileVersion>
<AssemblyVersion>5.8.1.0</AssemblyVersion>
<FileVersion>5.8.1.0</FileVersion>
<AppDesignerFolder>Properties</AppDesignerFolder>
<PackageIcon>Azure Explorer.png</PackageIcon>
<PackageIconUrl />
Expand Down Expand Up @@ -92,17 +92,17 @@
<ItemGroup>
<PackageReference Include="Azure.Monitor.Query" Version="1.2.0" />
<PackageReference Include="Azure.ResourceManager" Version="1.9.0" />
<PackageReference Include="Azure.ResourceManager.Media" Version="1.2.0" />
<PackageReference Include="Azure.ResourceManager.Media" Version="1.3.0" />
<PackageReference Include="Azure.ResourceManager.Resources" Version="1.7.0" />
<PackageReference Include="Azure.ResourceManager.Storage" Version="1.1.1" />
<PackageReference Include="Azure.ResourceManager.Storage" Version="1.2.0" />
<PackageReference Include="DocumentFormat.OpenXml" Version="3.0.0" />
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.21.0" />
<PackageReference Include="Microsoft.ApplicationInsights.WindowsServer" Version="2.21.0" />
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.22.0" />
<PackageReference Include="Microsoft.ApplicationInsights.WindowsServer" Version="2.22.0" />
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="25.0.0" />
<PackageReference Include="Microsoft.Azure.Storage.DataMovement" Version="2.0.4" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.Identity.Client.Broker" Version="4.57.0" />
<PackageReference Include="Microsoft.Identity.Client.Broker" Version="4.58.1" />
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="2.3.24" />
<PackageReference Include="Microsoft.Rest.ClientRuntime.Azure.Authentication" Version="2.4.1" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2151.40" />
Expand Down
2 changes: 1 addition & 1 deletion AMSExplorer/CopyAsset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ private async void listViewAccounts_SelectedIndexChanged(object sender, EventArg
MediaServicesAccountResource response;
try
{
response = await DestinationAmsClient.ConnectAndGetNewClientV3Async(this);
response = await DestinationAmsClient.ConnectAndGetNewClientV3Async(this, false);
}
catch (Exception ex)
{
Expand Down
Loading

0 comments on commit 6064c81

Please sign in to comment.