Identity/BrowserID: Difference between revisions

Jump to navigation Jump to search
Line 167: Line 167:
  // get parameters of provisioning
  // get parameters of provisioning
  navigator.id.beginProvisioning(function(email, cert_duration) {
  navigator.id.beginProvisioning(function(email, cert_duration) {
 
     // ... check if the current user is authenticated as 'email' ...
     // ... check if the current user is authenticated as 'email' ...
     if (notAuthenticated()) {
     if (notAuthenticated()) {
         navigator.id.raiseProvisioningFailure("user isn't authenticated");
         navigator.id.raiseProvisioningFailure("user isn't authenticated");
     }
     }
 
     // request a keypair be generated by browserid and get the public key
     // request a keypair be generated by browserid and get the public key
     navigator.id.genKeyPair(function(pubkey) {
     navigator.id.genKeyPair(function(pubkey) {
 
         // ... interact with the server to sign the public key and get
         // ... interact with the server to sign the public key and get
         // a certificate ...
         // a certificate ...
         var cert = someServerInteraction();
         var cert = someServerInteraction();
 
         // pass the certificate back to BrowserID and complete the
         // pass the certificate back to BrowserID and complete the
         // provisioining process
         // provisioining process
668

edits

Navigation menu