Skip to content

Commit

Permalink
Update ext
Browse files Browse the repository at this point in the history
  • Loading branch information
neha-bhargava committed Jun 6, 2024
1 parent fddb2c4 commit 61a89f7
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,11 @@ private bool IsValidPath(string path)
{
string expandedExpectedPath = Environment.ExpandEnvironmentVariables("%ProgramData%\\AzureConnectedMachineAgent\\Tokens\\");

expectedFilePath = expandedExpectedPath + Path.GetFileName(path);
expectedFilePath = expandedExpectedPath + Path.GetFileNameWithoutExtension(path) + ".key";
}
else if (DesktopOsHelper.IsLinux())
{
expectedFilePath = "/var/opt/azcmagent/tokens/" + Path.GetFileName(path);
expectedFilePath = "/var/opt/azcmagent/tokens/" + Path.GetFileNameWithoutExtension(path) + ".key";
}
else
{
Expand All @@ -194,8 +194,7 @@ private bool IsValidPath(string path)
MsalErrorMessage.ManagedIdentityPlatformNotSupported);
}

return path.Equals(expectedFilePath, StringComparison.OrdinalIgnoreCase) &&
path.EndsWith(".key", StringComparison.OrdinalIgnoreCase);
return path.Equals(expectedFilePath, StringComparison.OrdinalIgnoreCase);
}
}
}

0 comments on commit 61a89f7

Please sign in to comment.