Work in Progress! This site does not represent the current state of Persona or BrowserID.

Relying Party (RP) API

Warning This API ("Goldilocks") is not fully implemented. Follow Bug 4134 for more information on its progress.

navigator.id.watch( parameters )

Configure BrowserID by registering callbacks and setting display options.

Implementation Notes:
  • May only be called once. Subsequent calls must be ignored and should log an error.
  • User input should be treated carefully — siteLogo may be an SVG, which opens an avenue for scripting.
Required Parameters:
onlogin: function (assertion) { … }
Callback. Invoked when a user attempts to sign in. Receives a Backed Identity Assertion as its first argument.
Optional Parameters:
Not Implemented onready: function () { … }
Callback. Invoked when the user agent is ready to handle BrowserID API calls.
Visual Customization (Optional):
Not Implemented siteName: String (Freeform text)
Human-friendly name of the Relying Party.
Not Implemented siteLogo: String (URL, absolute path, or data: URI)
Image that represents the Relying Party.
Not Implemented backgroundColor: String (Hex #rgb or #rrggbb)
Background color for displaying Relying Party information.

navigator.id.request( parameters )

Prompt the user to select an email address and sign into the Relying Party. Upon successful completion, a Backed Identity Assertion is passed to the onlogin callback registered in navigator.id.watch().

Implementation Notes:
  • Must be called in response to direct user action, such as a click.
  • Raises an error if called before navigator.id.watch() has been invoked.
Behavior Customization (Optional):
Not Implemented email: String (Email address)
Skip address selection and attempt to authenticate the user as the given email address.
oncancel: function () { … }
Callback. Invoked if the user closes the login prompt without selecting an address.