<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">First, I wanted to say congratulations all around on this workweek.  You guys blew far past my own expectation of what was possible in one week.  Respect.<div><br></div><div>The architecture you came to sounds like a pragmatic compromise given our constraints.</div><div><br></div><div>What I would like is a gecko and gaia tree that can be built so that we can:</div><div><div>1. develop a sample app (one that requires firefox accounts as wheresmyfox will)</div></div><div>2. screencast what we've done</div><div>3. give the wheresmyfox folks a target for integration testing.</div><div><br></div><div>To those ends, I have two questions:</div><div>1. What work remains before we will have functional sign up/sign in via navigator.mozId with wantIssuer specified?</div><div>2. Would it be worthwhile to create a branch of gaia and moz-central with in flight patches applied?</div><div><br></div><div><3,</div><div>lloyd</div><div><br></div><div><div><div>On Oct 29, 2013, at 7:32 AM, Fernando Jiménez Moreno <<a href="mailto:ferjmoreno@gmail.com">ferjmoreno@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi folks!<div><br></div><div>As you may know, last week some of us met in Madrid to work on FxA for FxOS.</div><div><br></div><div>We went through almost 4 different architectures but it seems that we finally are sticking to the following one:</div><div><br></div><div><a href="http://www.gliffy.com/go/publish/image/5029439/L.png">http://www.gliffy.com/go/publish/image/5029439/L.png</a></div><div><br></div><div>Where:</div><div><br></div><div><ul class="MailOutline"><li>We decided to build as much as possible in the platform as we figured out that landing PiCL-Gherkin [1] in Gaia isn't really a viable option. The platform already provides some of the required pieces and most of the ones that are left are supposed to be reused by other products (Desktop and Android). Some of the required work is being tracked in [2]. </li><li>The System app will be the proxy between the FxA management apps (FTU and Settings so far) and the platform. The communication will be based in an API built on top of IAC [3]. We built a small helper [4] for this. The communication between the System app and the platform will be done via the usual moz(Content/Chrome)Events. Most of the System app work is being done in [5].</li><li>RPs will use the current navigator.mozId API  with a small tweak to request FxA credentials. We decided not to use the once suggested <meta> tag for RPs and instead require a " wantIssuer: 'firefox-accounts' " field within the navigator.mozId.* calls. This work is being tracked in [6]</li><li>We chose to build a common FxA UI flow in System to be triggered by the FxA managers and by non-certified RPs (via the navigator.mozId API), which allow us to reuse code and avoid spawning a new child process for this flow.</li></ul></div><div><br></div><div>Diving a bit more into the specifics of the current architecture and implementation, an example of a request coming from FTU with the FxA UI flow involved like the one shown in [7] would be:</div><div><br></div><div>1- FTU wants to open the FxA flow (after the user clicks in the "Create Account or Log in" button shown in [7]).</div><div>2- FTU uses FxAccountsIACHelper to request the launch of the FxA flow.</div><div>3- The System app gets the IAC request in FxAccountsManager and opens the FxA flow via FxAccountsUI.</div><div>4- The first screen of the FxA flow is shown with the email form to be filled by the user.</div><div>5- The user enters her email and clicks "Next".</div><div>6- FxAccountsUI makes use of FxAccountsClient.queryAccount method to request the state of the account associated with the user's email.</div><div>7- FxAccountsClient sends a mozContentEvent that is handled by the SignInToFxA platform module.</div><div>8- SignInToFxA makes use of FxAClient module to query the FxA server [8].</div><div>9- Once we get a reply from the server, the response is delivered back to content via a mozChromeEvent sent from SignInToFxA.</div><div>10- FxAccountsClient handles this mozChromeEvent and FxAccountsManager sends the response to FTU via IAC.</div><div><br></div><div>Note that some requests (like the one that should be used by Settings to get the details of the currently signed accounts) might not need the FxA UI flow.</div><div><br></div><div>Any feedback is highly appreciated.</div><div><br></div><div>Cheers!</div><div><br></div><div>/ Fernando</div><div><br></div><div>[1] <a href="https://github.com/mozilla/picl-gherkin">https://github.com/mozilla/picl-gherkin</a></div><div>[2] <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=930598">https://bugzilla.mozilla.org/show_bug.cgi?id=930598</a></div><div>[3] <a href="https://wiki.mozilla.org/WebAPI/Inter_App_Communication_Alt_proposal">https://wiki.mozilla.org/WebAPI/Inter_App_Communication_Alt_proposal</a></div><div>[4] <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=929407">https://bugzilla.mozilla.org/show_bug.cgi?id=929407</a></div><div>[5] <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=929388">https://bugzilla.mozilla.org/show_bug.cgi?id=929388</a></div><div>[6] <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=929386">https://bugzilla.mozilla.org/show_bug.cgi?id=929386</a></div><div>[7] <a href="https://www.dropbox.com/s/bw95tx4e9efceol/fxa_animation_flow.m4v">https://www.dropbox.com/s/bw95tx4e9efceol/fxa_animation_flow.m4v</a></div><div>[8] <a href="https://github.com/mozilla/picl-server">https://github.com/mozilla/picl-server</a></div></div>_______________________________________________<br>Dev-fxacct mailing list<br><a href="mailto:Dev-fxacct@mozilla.org">Dev-fxacct@mozilla.org</a><br>https://mail.mozilla.org/listinfo/dev-fxacct<br></blockquote></div><br></div></body></html>