Created
April 24, 2017 08:13
-
-
Save mmierzwa/3692b6cc9d7a26c167e661879e61786a to your computer and use it in GitHub Desktop.
Cleaning ADAL token cache on Android and iOS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SecureStorageService : ISecureStorageService | |
{ | |
private const string SharedPreferencesName = "ActiveDirectoryAuthenticationLibrary"; | |
private const string SharedPreferencesKey = "cache"; | |
private static ISharedPreferences SharedPreferences => | |
Application.Context.GetSharedPreferences(SharedPreferencesName, FileCreationMode.Private); | |
public void RemoveAdalRecords() | |
{ | |
try | |
{ | |
var editor = SharedPreferences.Edit(); | |
editor.Remove(SharedPreferencesKey); | |
} | |
catch (Exception ex) | |
{ | |
// log the error | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment