AzureAD / microsoft-authentication-library-common-for-android

Common code used by both the Active Directory Authentication Library (ADAL) and the Microsoft Authentication Library (MSAL)
MIT License
41 stars 35 forks source link

Add method to flush shared preference file manager #2130

Closed sansrivastav closed 1 year ago

sansrivastav commented 1 year ago

AB#2596635 We have seen that when trying to sign out an account from PowerApps, OneAuth-MSAL marks the force prompt flag on account and that makes a call to SharedPreferencesFileManager.putString() to update the account properties. After this PowerApps makes a call to MAM API to unregister account and this causes the PowerApps to get force closed. Since the application is killed, the SharedPreferece apply() could not complete and the account properties are not properly stored. Proposed solution is to have a flush method which will be called by OneAuth-MSAL when critical account properties such as sign out flag need to be updated.