fxa-crypto-relier/docs
Ryan Kelly c1553ccb86 fix(keys): Use full millisecond timestamp in legacy sync kid. (#19) r=@vladikoff
The full timestamp is required for proper interoperability
with the Sync Tokenserver, which uses the millisecond generation
number when processing BrowserID assertions.
2018-04-23 19:13:58 -04:00
..
PRIVATE.md fix(keys): Use full millisecond timestamp in legacy sync kid. (#19) r=@vladikoff 2018-04-23 19:13:58 -04:00
README.md fix(scopes): adjust scope TLD (#11) r=@rfk 2017-11-23 22:01:02 -05:00
template.hbs feat(keys): start lib commit r=@rfk 2017-11-16 10:42:22 -05:00

README.md

Firefox Accounts Scoped Key Relier Documentation

Also see Deriver and Private method documentation.

OAuth methods to authenticate with Firefox Accounts and get scoped keys

Example

const fxaKeysUtil = new fxaCryptoRelier.OAuthUtils();

fxaKeysUtil.launchWebExtensionKeyFlow('YOUR_CLIENT_ID', {
  redirectUri: browser.identity.getRedirectURL(),
  scopes: ['profile', 'https://identity.mozilla.com/apps/lockbox'],
}).then((loginDetails) => {
  const key = loginDetails.keys['https://identity.mozilla.com/apps/lockbox'];
  const credentials = {
    access_token: loginDetails.access_token,
    refresh_token: loginDetails.refresh_token,
    key
};

relier-OAuthUtils~launchWebExtensionKeyFlow(clientId, [options]) ⇒ Promise

Used to launch the Firefox Accounts scope key login flow in WebExtensions

Kind: inner method of relier-OAuthUtils

Param Type Default Description
clientId string FxA relier client id
[options] object {}
[options.scopes] array [] Requested OAuth scopes
[options.browserApi] object browser Custom browser API override
[options.getBearerTokenRequest] function getBearerTokenRequest Custom getBearerTokenRequest function override