Account manager
In the context of storing sensitive data, storing passwords or authentication tokens is an important aspect. Consider applications such as Google Mail, Twitter, and Facebook, which lets users log in. Other applications work with an authentication token as used by identity protocols such as OAuth2.
Android provides the android.accounts.AccountManager
class as a centralized repository for storing user credentials. An application can choose to use its own pluggable authenticator to handle account authentication. From storing the username to identity information to creating your custom account manager, Android's AccountManager
is a powerful utility.
The AccountManager
class functions are permissions protected so that your application will have to request for android.permission.GET_ACCOUNTS
to access the list of accounts stored on it and android.permission.ACCOUNT_MANAGER
for OAuth2.
Each account is in a namespace format. For example, a Google account uses com.google
and a Twitter...