question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] PlatformNotSupportedException in macOS App

See original GitHub issue

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: https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/blob/79b57039a076391fe350a736fe9c951322fdd422/src/client/Microsoft.Identity.Client/TokenCache.Notifications.cs#L156-L164

Actual behavior No exception when adding custom token cache

Additional context/ Logs / Screenshots Screenshot 2020-11-26 at 08 26 27

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
bgavrilMScommented, Dec 2, 2020

Ack, please stay on MSAL 4.22 for now. Will get this shipped in 1-2 weeks.

1reaction
ghelyarcommented, Dec 2, 2020

For reference, we’re also using this on Xamarin.Mac in order to use the macOS keychain as the token cache.

Without this, iOS uses the keychain, but macOS does not.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why do I get the Error "Unhandled exception. System. ...
I try get the text from a Word document, but it will always show me the error. I am using .Net 7.0 and...
Read more >
Security - PlatformNotSupportedException (Operation is ...
Running the iOS project from vs 2019 on pc. I am using E4098 to connect the Xamarin app to the XPO/XAF back-end. This...
Read more >
System.PlatformNotSupportedException
I use Linux Mint 21 and Visual Studio Code. The thing is that when coding a console app I tried to use this...
Read more >
Mac OS, Linux - .NET Core 3.0 reporting application failed ...
Mac OS, Linux - .NET Core 3.0 reporting application failed with 'PlatformNotSupportedException: System.Windows.Extensions types are not ...
Read more >
HttpClientHandler Proxy Unsupported - Microsoft Q&A
In the MacOS, Proxy member in HttpClientHandler throw exception "Operation is not supported on this platform." In code is marked
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found