navigator.id

  • Revision slug: DOM/navigator.id
  • Revision title: navigator.id
  • Revision id: 360715
  • Created:
  • Creator: AmitSingla9
  • 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

The BrowserID protocol defines a new id property on the {{ domxref ("window.navigator")}} object, through which it exposes the BrowserID API. This API has gone through several significant revisions. Each generation is listed separately below.

The "Observer" API (Current)

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.

{{ domxref("navigator.id.watch()")}}
Registers callbacks to be invoked when a user logs into or out of a website.
{{ domxref("navigator.id.request()")}}
Requests a signed identity assertion from the user.
{{ domxref("navigator.id.logout()")}}
Logs the user out of a website and prevents the onlogin action from automatically firing on their next visit.

Users with 3rd party cookies disabled may experience problems logging in using the Observer API as detailed in issue 2999.

The "Callback" API (Current)

The Callback API 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.

{{ domxref("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.

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

Revision Source

<div>
  {{ DomRef() }} {{ non-standard_header() }}</div>
<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>
<h2 id="Summary" name="Summary">Summary</h2>
<p>The <a href="/en-US/docs/Persona" title="BrowserID">BrowserID protocol</a> defines a new <code>id</code> property on the {{ domxref ("window.navigator")}} object, through which it exposes the BrowserID API. This API has gone through several significant revisions. Each generation is listed separately below.</p>
<h2 id="ObserverMethods" name="ObserverMethods">The "Observer" API (Current)</h2>
<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.</p>
<dl>
  <dt>
    {{ domxref("navigator.id.watch()")}}</dt>
  <dd>
    Registers callbacks to be invoked when a user logs into or out of a website.</dd>
  <dt>
    {{ domxref("navigator.id.request()")}}</dt>
  <dd>
    Requests a signed identity assertion from the user.</dd>
  <dt>
    {{ domxref("navigator.id.logout()")}}</dt>
  <dd>
    Logs the user out of a website and prevents the <code>onlogin</code> action from automatically firing on their next visit.</dd>
</dl>
<div class="note">
  <p>Users with 3rd party cookies disabled may experience problems logging in using the Observer API as detailed in&nbsp;<a href="https://github.com/mozilla/browserid/issues/2999" title="https://github.com/mozilla/browserid/issues/2999">issue 2999</a>.</p>
</div>
<h2 id="CallbackMethods" name="CallbackMethods">The "Callback" API (Current)</h2>
<p>The Callback API 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>
    {{ domxref("navigator.id.get()")}}</dt>
  <dd>
    Gets the user's BrowserID in a signed assertion.</dd>
</dl>
<h2 id="VerifiedEmailMethods" name="VerifiedEmailMethods">The "VerifiedEmail" API (Deprecated)</h2>
<p>The VerifiedEmail API was BrowserID's first API. It was deprecated at the end of 2011.</p>
<dl>
  <dt>
    {{ domxref("navigator.id.getVerifiedEmail()")}} {{ deprecated_inline() }}</dt>
  <dd>
    Gets the user's BrowserID in a signed assertion. This method is deprecated; {{ domxref("navigator.id.get()")}} is backwards compatible and can be used instead.</dd>
</dl>
Revert to this revision