Token cache is not persisted on iOS Simulator
See original GitHub issueCurrently, 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:
- Created 5 years ago
- Comments:15 (10 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Closing this issue as @MathildeRoussel added missing steps in the iOS specific considerations
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