From 1e91820f7810e9356ec3e781feeda00f0c4fb4a7 Mon Sep 17 00:00:00 2001 From: Peter M <34331512+pmaytak@users.noreply.github.com> Date: Thu, 4 Aug 2022 13:24:08 -0700 Subject: [PATCH] Update to MSAL 4.46.0. (#188) * Update to MSAL 4.46.0. * Fix calling correct AcquireTokenByUP * Fix. --- sample/ManualTestApp/ManualTestApp.csproj | 2 +- sample/ManualTestApp/Program.cs | 22 +++++-------------- ...oft.Identity.Client.Extensions.Msal.csproj | 2 +- tests/Automation.TestApp/Program.cs | 2 +- ...ty.Client.Extensions.Msal.UnitTests.csproj | 2 +- 5 files changed, 10 insertions(+), 20 deletions(-) diff --git a/sample/ManualTestApp/ManualTestApp.csproj b/sample/ManualTestApp/ManualTestApp.csproj index 8f99da6..f213e90 100644 --- a/sample/ManualTestApp/ManualTestApp.csproj +++ b/sample/ManualTestApp/ManualTestApp.csproj @@ -10,7 +10,7 @@ - + diff --git a/sample/ManualTestApp/Program.cs b/sample/ManualTestApp/Program.cs index 8559868..de7267e 100644 --- a/sample/ManualTestApp/Program.cs +++ b/sample/ManualTestApp/Program.cs @@ -4,11 +4,9 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using System.Globalization; using System.IO; using System.Linq; using System.Reflection; -using System.Security; using System.Text; using System.Threading.Tasks; using Microsoft.Identity.Client; @@ -305,20 +303,12 @@ private static async Task AcquireTokenROPCAsync( throw new InvalidOperationException("Please configure a username and password!"); } - using (SecureString securePassword = new SecureString()) - { - foreach (char c in Config.Password) - { - securePassword.AppendChar(c); - } - - return await pca.AcquireTokenByUsernamePassword( - Config.Scopes, - Config.Username, - securePassword) - .ExecuteAsync() - .ConfigureAwait(false); - } + return await pca.AcquireTokenByUsernamePassword( + Config.Scopes, + Config.Username, + Config.Password) + .ExecuteAsync() + .ConfigureAwait(false); } private static void DisplayResult(AuthenticationResult result) diff --git a/src/Microsoft.Identity.Client.Extensions.Msal/Microsoft.Identity.Client.Extensions.Msal.csproj b/src/Microsoft.Identity.Client.Extensions.Msal/Microsoft.Identity.Client.Extensions.Msal.csproj index 5a0b07f..3c8d7b3 100644 --- a/src/Microsoft.Identity.Client.Extensions.Msal/Microsoft.Identity.Client.Extensions.Msal.csproj +++ b/src/Microsoft.Identity.Client.Extensions.Msal/Microsoft.Identity.Client.Extensions.Msal.csproj @@ -36,7 +36,7 @@ - + diff --git a/tests/Automation.TestApp/Program.cs b/tests/Automation.TestApp/Program.cs index d20b9ce..bbf2327 100644 --- a/tests/Automation.TestApp/Program.cs +++ b/tests/Automation.TestApp/Program.cs @@ -48,7 +48,7 @@ private async static Task WritePayloadToSyncFileAsync(string lockFile, string pr { string pid = Process.GetCurrentProcess().Id.ToString(CultureInfo.InvariantCulture); string errorFile = protectedFile + $"{pid}.e.txt"; - string pidFIle = Path.Combine(Path.GetDirectoryName(protectedFile), "finished", pid + ".txt"); + string pidFIle = Path.Combine(Path.GetDirectoryName(protectedFile), pid + ".txt"); Console.WriteLine("Starting process: " + pid); CrossPlatLock crossPlatLock = null; diff --git a/tests/Microsoft.Identity.Client.Extensions.Msal.UnitTests/Microsoft.Identity.Client.Extensions.Msal.UnitTests.csproj b/tests/Microsoft.Identity.Client.Extensions.Msal.UnitTests/Microsoft.Identity.Client.Extensions.Msal.UnitTests.csproj index f868747..b42c0ed 100644 --- a/tests/Microsoft.Identity.Client.Extensions.Msal.UnitTests/Microsoft.Identity.Client.Extensions.Msal.UnitTests.csproj +++ b/tests/Microsoft.Identity.Client.Extensions.Msal.UnitTests/Microsoft.Identity.Client.Extensions.Msal.UnitTests.csproj @@ -7,7 +7,7 @@ - +