Skip to content

Commit 61a89f7

Browse files
committed
Update ext
1 parent fddb2c4 commit 61a89f7

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/client/Microsoft.Identity.Client/ManagedIdentity/AzureArcManagedIdentitySource.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,11 @@ private bool IsValidPath(string path)
181181
{
182182
string expandedExpectedPath = Environment.ExpandEnvironmentVariables("%ProgramData%\\AzureConnectedMachineAgent\\Tokens\\");
183183

184-
expectedFilePath = expandedExpectedPath + Path.GetFileName(path);
184+
expectedFilePath = expandedExpectedPath + Path.GetFileNameWithoutExtension(path) + ".key";
185185
}
186186
else if (DesktopOsHelper.IsLinux())
187187
{
188-
expectedFilePath = "/var/opt/azcmagent/tokens/" + Path.GetFileName(path);
188+
expectedFilePath = "/var/opt/azcmagent/tokens/" + Path.GetFileNameWithoutExtension(path) + ".key";
189189
}
190190
else
191191
{
@@ -194,8 +194,7 @@ private bool IsValidPath(string path)
194194
MsalErrorMessage.ManagedIdentityPlatformNotSupported);
195195
}
196196

197-
return path.Equals(expectedFilePath, StringComparison.OrdinalIgnoreCase) &&
198-
path.EndsWith(".key", StringComparison.OrdinalIgnoreCase);
197+
return path.Equals(expectedFilePath, StringComparison.OrdinalIgnoreCase);
199198
}
200199
}
201200
}

0 commit comments

Comments
 (0)