@@ -4,17 +4,29 @@ A library for integrating with Firefox Accounts.
## Motivation
The **Firefox Accounts Android Component** provides a way for Android applications to do the following:
The **Firefox Accounts Android Component** provides both low and high level accounts functionality.
* Obtain OAuth tokens that can be used to access the user's data in Mozilla-hosted services like Firefox Sync
At a low level, there is direct interaction with the accounts system:
* Obtain scoped OAuth tokens that can be used to access the user's data in Mozilla-hosted services like Firefox Sync
* Fetch client-side scoped keys needed for end-to-end encryption of that data
* Fetch a user's profile to personalize the application
See also the [sample app](https://github.com/mozilla-mobile/android-components/tree/master/samples/firefox-accounts)
for help with integrating this component into your application.
At a high level, there is an Account Manager:
* Handles account state management and persistence
* Abstracts away OAuth details, handling scopes, token caching, recovery, etc. Application can still specify custom scopes if needed
* Integrates with FxA device management, automatically creating and destroying device records as appropriate
* (optionally) Provides Send Tab integration - allows sending and receiving tabs within the Firefox Account ecosystem
* (optionally) Provides Firefox Sync integration
## Usage
Sample applications:
*[accounts sample app](https://github.com/mozilla-mobile/android-components/tree/master/samples/firefox-accounts), demonstrates how to use low level APIs
*[sync app](https://github.com/mozilla-mobile/android-components/tree/master/samples/sync), demonstrates a high level accounts integration, complete with syncing multiple data stores
Useful companion components:
*[feature-accounts](https://github.com/mozilla-mobile/android-components/tree/master/components/feature/accounts), provides a `tabs` integration on top of `FxaAccountManager`, to handle display of web sign-in UI.
*[browser-storage-sync](https://github.com/mozilla-mobile/android-components/tree/master/components/browser/storage-sync), provides data storage layers compatible with Firefox Sync.
## Usage
### Setting up the dependency
Use Gradle to download the library from [maven.mozilla.org](https://maven.mozilla.org/)([Setup repository](../../../README.md#maven-repository)):
...
...
@@ -23,7 +35,134 @@ Use Gradle to download the library from [maven.mozilla.org](https://maven.mozill
* Added custom notification icon for `FetchDownloadManager`.
***feature-accounts**
* ⚠️ **This is a breaking change**: Public API for interacting with `FxaAccountManager` and sync changes
*`FxaAccountManager` now has a new, simplified public API.
*`BackgroundSyncManager` is longer exists; sync functionality exposed directly via `FxaAccountManager`.
* See component's [README](https://github.com/mozilla-mobile/android-components/blob/master/components/service/firefox-accounts/README.md) for detailed description of the new API.
* As part of these changes, token caching issue has been fixed. See [#3579](https://github.com/mozilla-mobile/android-components/pull/3579) for details.