Accounts count sets to 0 in MSAL, after the application auto update. (Windows) #22928
Labels
area-infrastructure
CI, Maestro / Coherency, upstream dependencies/versions
platform/windows 🪟
t/bug
Something isn't working
Description
Hello,
I hope this message finds you well. I am reaching out to report an issue I am encountering with MSAL authentication in my MAUI application, specifically related to the automatic update process using the embedded appinstaller.
Here is the scenario:
I have followed the approach outlined in the Microsoft documentation on how to embed an appinstaller file for automatic updates, but it seems that the authentication state is not being preserved during the update process. [https://learn.microsoft.com/en-us/windows/msix/app-installer/how-to-embed-an-appinstaller-file]
Could you please assist me in resolving this issue? I would appreciate any guidance or suggestions on how to ensure that the MSAL authentication state is maintained across application updates.
Thank you for your attention to this matter. I look forward to your prompt response and assistance in resolving this issue.
FYI
![image](https://private-user-images.githubusercontent.com/155944444/337863829-4b7c72f7-4c79-4dd7-b437-3c68f5d07134.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjMwNjAwMTcsIm5iZiI6MTcyMzA1OTcxNywicGF0aCI6Ii8xNTU5NDQ0NDQvMzM3ODYzODI5LTRiN2M3MmY3LTRjNzktNGRkNy1iNDM3LTNjNjhmNWQwNzEzNC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODA3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgwN1QxOTQxNTdaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0wM2ZkOWUxZDdmM2Q0ZmE1MDJhN2E2NTE2NmRlMDgzMDM2MGUzYWRkOWQ2OGU1ZjA2OWYxNmRkOGNiNDcwZjVhJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.ZVqnb51aFiSgAbBe_NPCIxeSqmtZmhTKgsbOO2_a3Rg)
I'm using this way for caching for windows.
`if(Device.RuntimePlatform == Device.UWP)
{
mPublicClientApplication = PublicClientApplicationBuilder.Create(options.ClientId)
.WithAuthority(options.Authority)
.WithRedirectUri(SpecialRedirectUri ?? $"msal{options.ClientId}://auth")
.WithWindowsEmbeddedBrowserSupport()
}`
`private async Task AttachTokenCache(ITokenCache tokenCache)
{
string CacheFilePath = $"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)}\abccache\msalcache.bin";
StorageCreationProperties storageProperties = new StorageCreationPropertiesBuilder("abccache", CacheFilePath).Build();
Thanks,
Vaibhav Methuku.
Steps to Reproduce
No response
Link to public reproduction project repository
No response
Version with bug
Unknown/Other
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
8.0.0-preview.1.7762
Affected platforms
Windows
Affected platform versions
windows
Did you find any workaround?
No
Relevant log output
No response
The text was updated successfully, but these errors were encountered: