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.

Token cache is not persisted on iOS Simulator

See original GitHub issue

Currently, the user that logged in does not get stored in any way. So this part in OnAppearing never gets executed successfully, because there are no users: var ar = await App.PCA.AcquireTokenSilentAsync(App.Scopes, App.PCA.Users.FirstOrDefault());

Is there any way to persist the logged in user? So that the user does not have to relog every time the application closes and opens.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:15 (10 by maintainers)

github_iconTop GitHub Comments

3reactions
jmprieurcommented, Apr 29, 2018

Closing this issue as @MathildeRoussel added missing steps in the iOS specific considerations

3reactions
MathildeRousselcommented, Apr 28, 2018

Hello,

I’ve just tested this sample on an iOS simulator (iPhone X 11.3), the AcquireTokenSilentAsync works fine, only you have to specify in your provisioning profile that you want to use the Keychain, and then add in the Entitlements.plist a new key for keychain-access-group with your app bundle id.

After that I’m able to first log in with my password, and when I restart the app I’m already logged in (no need to click on “sign in” and to pick an account)

IMHO there is no bug, you can close this issue and also that one : https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/issues/546

Read more comments on GitHub >

github_iconTop Results From Across the Web

MSAL and the iOS Simulator - Code Mill Matt
But there's something wrong with the iOS Simulator - because the token caching does not seem to persist between app launches and you're ......
Read more >
Xamarin Forms MSAL cache not storing tokens on iOS
On Android, this method works so the user only needs to sign in the first time they use the app. However, on iOS...
Read more >
Erase app data on iOS simulator or real devices
The tokens in your app are not persisted in the settings bundle - so even though you could remove the settings bundle, it...
Read more >
Token cache serialization (MSAL.NET) - Microsoft Entra
In-memory token caches are faster than other cache types, but their tokens aren't persisted between application restarts, and you can't control ...
Read more >
Issue with Xcode 14 beta 4 and iOS 16 Simulator
I've encountered an issue using Xcode 14 beta 4. Updated to RevenueCat 4.9.0 and still seeing the issue. If I use a StoreKit...
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