c1553ccb86
The full timestamp is required for proper interoperability with the Sync Tokenserver, which uses the millisecond generation number when processing BrowserID assertions. |
||
---|---|---|
.. | ||
PRIVATE.md | ||
README.md | ||
template.hbs |
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 |