mozilla/browserid — Issue #912: add event-based RP API
Author: benadida
Created: 2012-01-18 23:25:57+00:00
State: open

We propose moving to an event-based API for web sites.

// this event is guaranteed to fire after window.onLoad
// so it's best if this event listener should be registered before window.onLoad
navigator.id.addEventListener('login', function(event) {
// do things with event.assertion
});

navigator.id.get({options});

Advantages:
* we do away with allowPersistent and silent, as those become entirely user-controlled now. The only option for that remains for now is requiredEmail.
* firing the login event can be done in a number of cases where the reference to the callback has otherwise been lost, e.g. when returning from having verified an email if the RP page was unloaded.