From 8a6fe480ea94d47552055972f10d398a3fda1936 Mon Sep 17 00:00:00 2001 From: Neha Bhargava <61847233+neha-bhargava@users.noreply.github.com> Date: Thu, 6 Jun 2024 13:52:56 -0700 Subject: [PATCH] Update AzureArcManagedIdentitySource.cs --- .../ManagedIdentity/AzureArcManagedIdentitySource.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/client/Microsoft.Identity.Client/ManagedIdentity/AzureArcManagedIdentitySource.cs b/src/client/Microsoft.Identity.Client/ManagedIdentity/AzureArcManagedIdentitySource.cs index f886347a14..bd085fb4c1 100644 --- a/src/client/Microsoft.Identity.Client/ManagedIdentity/AzureArcManagedIdentitySource.cs +++ b/src/client/Microsoft.Identity.Client/ManagedIdentity/AzureArcManagedIdentitySource.cs @@ -138,9 +138,7 @@ private void ValidateSplitChallenge(string[] splitChallenge) } _requestContext.Logger.Verbose(() => $"[Managed Identity] Challenge is valid. FilePath: {splitChallenge[1]}"); - string path = Path.GetFullPath(new Uri(splitChallenge[1]).LocalPath) - .TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); - + if (!IsValidPath(splitChallenge[1])) { throw CreateManagedIdentityException( @@ -148,7 +146,7 @@ private void ValidateSplitChallenge(string[] splitChallenge) MsalErrorMessage.ManagedIdentityInvalidFile); } - _requestContext.Logger.Verbose(() => $"[Managed Identity] File path is valid. Path: {path}"); + _requestContext.Logger.Verbose(() => $"[Managed Identity] File path is valid. Path: {splitChallenge[1]}"); var length = new FileInfo(splitChallenge[1]).Length;