navigator.id

  • Revision slug: DOM/navigator.id
  • Revision title: navigator.id
  • Revision id: 294115
  • Created:
  • Creator: Callahad
  • Is current revision? No
  • Comment

Revision Content

{{ DomRef() }}

{{ non-standard_header() }}

Note: Support for this functionality is not yet built into any browsers. Websites using Persona must include the polyfill library hosted at https://login.persona.org/include.js in their pages.

Summary

BrowserID adds a new id property to the window.navigator object. This property is an object that provides the BrowserID API.

The BrowserID API has gone through several significant revisions. Each generation of the API is listed separately below.

The "Observer" API (Experimental)

The Observer API introduces much-requested features, such as an improved post-verification experience for first-time users, automatic persistent logins, and easier integration with native applications. The API methods are currently available, but production use is discouraged until the API is announced as "stable" around or before September 2012.

navigator.id.watch() {{ experimental_inline() }}
Registers callbacks to be invoked when a user logs into or out of a website.
navigator.id.request() {{ experimental_inline() }}
Requests a signed assertion from the user.
navigator.id.logout() {{ experimental_inline() }}
Logs the user out of a website and prevents the onlogin event from firing automatically on the user's next visit to that site.

The "Callback" API (Current)

The Callback API is the current stable BrowserID API and was introduced in November 2011. It improved upon the initial API by allowing options to be passed to navigator.id.get() and offering experimental support for BrowserID-managed persistent sessions.

navigator.id.get()
Gets the user's BrowserID in a signed assertion.

The "VerifiedEmail" API (Deprecated)

The VerifiedEmail API was BrowserID's first API. It was deprecated at the end of 2011.

navigator.id.getVerifiedEmail() {{ deprecated_inline() }}
Gets the user's BrowserID in a signed assertion. This method is deprecated; navigator.id.get() is backwards compatible and can be used instead.

{{ languages( { "zh-cn": "zh-cn/DOM/navigator.id" } ) }}

Revision Source

<p>{{ DomRef() }}</p>
<p>{{ non-standard_header() }}</p>
<div class="note">
  <strong>Note:</strong> Support for this functionality is not yet built into any browsers. Websites using Persona must include the polyfill library hosted at <a class="link-https" href="https://login.persona.org/include.js" title="https://login.persona.org/include.js">https://login.persona.org/include.js</a> in their pages.</div>
<h3 id="Summary" name="Summary">Summary</h3>
<p><a href="/en/BrowserID" title="BrowserID">BrowserID</a> adds a new <code>id</code> property to the <code><a href="https://developer-new.mozilla.org/en-US/docs/DOM/window.navigator" rel="internal">window.navigator</a></code> object. This property is an object that provides the BrowserID API.</p>
<p>The BrowserID API has gone through several significant revisions. Each generation of the API is listed separately below.</p>
<h3 id="ObserverMethods" name="ObserverMethods">The "Observer" API (Experimental)</h3>
<p>The Observer API introduces much-requested features, such as an improved post-verification experience for first-time users, automatic persistent logins, and easier integration with native applications. The API methods are currently available, but production use is discouraged until the API is announced as "stable" around or before September 2012.</p>
<dl>
  <dt>
    <code><a href="https://developer-new.mozilla.org/en-US/docs/DOM/navigator.id.watch" rel="internal">navigator.id.watch()</a></code> {{ experimental_inline() }}</dt>
  <dd>
    Registers callbacks to be invoked when a user logs into or out of a website.</dd>
  <dt>
    <code><a href="https://developer-new.mozilla.org/en-US/docs/DOM/navigator.id.request" rel="internal">navigator.id.request()</a></code> {{ experimental_inline() }}</dt>
  <dd>
    Requests a signed assertion from the user.</dd>
  <dt>
    <code><a href="https://developer-new.mozilla.org/en-US/docs/DOM/navigator.id.logout" rel="internal">navigator.id.logout() </a></code>{{ experimental_inline() }}</dt>
  <dd>
    Logs the user out of a website and prevents the <code>onlogin</code> event from firing automatically on the user's next visit to that site.</dd>
</dl>
<h3 id="CallbackMethods" name="CallbackMethods">The "Callback" API (Current)</h3>
<p>The Callback API is the current stable BrowserID API and was introduced in November 2011. It improved upon the initial API by allowing options to be passed to <code>navigator.id.get()</code> and offering experimental support for BrowserID-managed persistent sessions.</p>
<dl>
  <dt>
    <code><a href="https://developer-new.mozilla.org/en-US/docs/DOM/navigator.id.get" rel="internal">navigator.id.get()</a></code></dt>
  <dd>
    Gets the user's BrowserID in a signed assertion.</dd>
</dl>
<h3 id="VerifiedEmailMethods" name="VerifiedEmailMethods">The "VerifiedEmail" API (Deprecated)</h3>
<p>The VerifiedEmail API was BrowserID's first API. It was deprecated at the end of 2011.</p>
<dl>
  <dt>
    <code><a href="https://developer-new.mozilla.org/en-US/docs/DOM/navigator.id.getVerifiedEmail" rel="internal">navigator.id.getVerifiedEmail()</a></code> {{ deprecated_inline() }}</dt>
  <dd>
    Gets the user's BrowserID in a signed assertion. This method is deprecated; <code><a href="https://developer-new.mozilla.org/en-US/docs/DOM/navigator.id.get" rel="internal">navigator.id.get()</a></code> is backwards compatible and can be used instead.</dd>
</dl>
<p>{{ languages( { "zh-cn": "zh-cn/DOM/navigator.id" } ) }}</p>
Revert to this revision