A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/issues/2251 below:

[Bug] PlatformNotSupportedException in macOS App · Issue #2251 · AzureAD/microsoft-authentication-library-for-dotnet · GitHub

Which Version of MSAL are you using ?
MSAL 4.23.0
MSAL Extensions 2.16.5

Platform
Xamarin.macOS

Is this a new or existing app?
a. The app is in production, and I have upgraded to a new version of MSAL

Repro

var storageProperties = new StorageCreationPropertiesBuilder("msal_cache.dat", Environment.GetFolderPath(Environment.SpecialFolder.Personal), ClientId)
    .WithMacKeyChain(Foundation.NSBundle.MainBundle.BundleIdentifier, "msal_account")
    .Build();
var cacheHelper = await MsalCacheHelper.CreateAsync(storageProperties).ConfigureAwait(false);
cacheHelper.RegisterCache(pca.UserTokenCache);

Expected behavior
After updating MSAL to 4.2.30 I get a PlatformNotSupportedException when trying to add a token cache which is being thrown here:

private static void GuardOnMobilePlatforms() { #if !SUPPORTS_CUSTOM_CACHE throw new PlatformNotSupportedException("You should not use these TokenCache methods on mobile platforms. " + "They are meant to allow applications to define their own storage strategy on .net desktop and non-mobile platforms such as .net core. " + "On mobile platforms, MSAL.NET implements a secure and performant storage mechanism. " + "For more details about custom token cache serialization, visit https://aka.ms/msal-net-serialization"); #endif }

Actual behavior
No exception when adding custom token cache

Additional context/ Logs / Screenshots


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4