Call request() only from a click handler

Persona is no longer actively developed by Mozilla. Mozilla has committed to operational and security support of the persona.org services until November 30th, 2016.

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

If you run a website that relies on Persona, you need to implement an alternative login solution for your users before this date.

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: wbamberg, Heisenberg_Terribly_Uncertain, Sheppy
 Last updated by: wbamberg,