I'm developing an Android app. For authentication the user needs to enter the user name and password and the server returns an expiring authentication token.
Currently I'm saving the token but not the credentials. What is the preferred safest method to save the credentials locally so that when the token authentication fails I can re-login the user using the saved credentials in the background without having the user to enter their credentials again.
I'm aware of saving data using SharedPreferences. But are they really secure? Can I use AccountManager for this purpose?