WebAPI/MobileIdentity: Difference between revisions

 
(7 intermediate revisions by 3 users not shown)
Line 23: Line 23:
=== Code example ===
=== Code example ===
<code>
<code>
   function verifyAssertion(aAssertion) {
   function _verifyAssertion(aAssertion) {
     // Make use of the [https://wiki.mozilla.org/Identity/Firefox_Accounts#Verifier remote verification API]
     // Make use of the [https://wiki.mozilla.org/Identity/Firefox_Accounts#Verifier remote verification API]
     // and return the verified msisdn.
     // and return the verified msisdn.
    // NB: This is necessary to make sure that the user *really* controls this phone number!
   }
   }
    
    
Line 33: Line 34:
   .then(
   .then(
     (assertion) => {
     (assertion) => {
       var msisdn = verifyAssertion(assertion);
       _verifyAssertion(assertion)
       // Do stuff with the msisdn.
       .then(
        (msisdn) => {
          // Do stuff with the msisdn.
        }
      );
     },
     },
     (error) {
     (error) {
Line 49: Line 54:
{{Bug|1021594}}
{{Bug|1021594}}


== High level architecture ==
=== Client ===
==== Debugging ====
To obtain Mobile ID debug messages in the adb logcat you need to set the following [https://developer.mozilla.org/en-US/Firefox_OS/Developing_Gaia/Build_System_Primer#Customizing_the_preferences preferences]:
<code>
  user_pref("services.mobileid.loglevel", "Debug");
  user_pref("services.hawk.loglevel", "Debug");
  user_pref("services.hawk.log.sensitive", true);
</code>
 
You should see debug messages like:
 
<code>
  Gecko  I  1411760725167 MobileId DEBUG getMobileIdAssertion
</code>
 
You might also need to change the server url for testing purposes. To do so, you can set the following preference:
<code>
  user_pref("services.mobileid.server.uri", "https://msisdn-dev.stage.mozaws.net");
</code>
 
=== Mobile ID verification service ===
[https://wiki.mozilla.org/Services/Mobile-ID Mobile ID verification service]
 
[[Category:Web APIs]]
Confirmed users
483

edits