Call request() only from a click handler

On November 30th, 2016, Mozilla shut down the persona.org services. Persona.org and related domains will soon be taken offline.

For more information, see this guide to migrating your site away from Persona:

https://wiki.mozilla.org/Identity/Persona_Shutdown_Guidelines_for_Reliers

The Persona dialog is currently implemented as a popup window. Modern web browsers typically block popups, unless they are triggered directly by a mouse click or a key press. This means that your call to navigator.id.request() or navigator.id.get() must be made directly from a click or keypress handler. If it's made in response to some other event, the popup won't be shown and the user won't be able to sign in.

For example: suppose your website has deferred sign-in, in which users can browse content, but do not have to sign in until they start editing. If you implement this by calling navigator.id.request() in response to a focus event on the text field, then the popup will be blocked.

You can still implement sign-in on focus as follows: on the focus event, display a dialog with a "Sign In" button, and have that button call navigator.id.request() in its click handler.

Document Tags and Contributors

Tags: 
 Contributors to this page: Sheppy, wbamberg, Heisenberg_Terribly_Uncertain
 Last updated by: Sheppy,