The fxa-client component lets applications integrate with the Firefox Accounts identity service. The shape of a typical integration would look something like:
Out-of-band, register your application with the Firefox Accounts service, providing an OAuth
redirect_uricontrolled by your application and obtaining an OAuth
On application startup, create a
FirefoxAccountobject to represent the signed-in state of the application.
When the user wants to sign in to your application, direct them through a web-based OAuth flow using
begin_pairing_flow; when they return to your registered
redirect_uri, pass the resulting authorization state back to
complete_oauth_flowto sign them in.
Display information about the signed-in user by using the data from
Access account-related services on behalf of the user by obtaining OAuth access tokens via
If the user opts to sign out of the application, calling
disconnectand then discarding any persisted account data.
- An OAuth access token, with its associated keys and metadata.
- A client connected to the user’s account.
- Information about the authorization state of the application.
- Parameters provided in an incoming OAuth request.
- A device connected to the user’s account.
- Details of a web-push subscription endpoint.
- Object representing the signed-in state of an application.
- Local device that’s connecting to FxA
- Information about the user that controls a Firefox Account.
- A cryptograpic key associated with an OAuth scope.
- The payload sent when invoking a “send tab” command.
- An individual entry in the navigation history of a sent tab.
- An event that happened on the user’s account.
- A “capability” offered by a device.
- Enumeration for the different types of device.
- FxA internal error type These are used in the internal code. This error type is never returned to the consumer.
- Public error type thrown by many [
- High-level view of the authorization state
- A command invoked by another device.
- Result returned by public-facing API functions
- Result returned by internal functions