<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello Vic,<br>
    <br>
    So basically all you want to do is to get the user id after the
    login, is that right?<br>
    <br>
    If I get it right, all you have to do is to register a client to
    Firefox Account (you can do it yourself for development here:
    <a class="moz-txt-link-freetext" href="https://oauth-stable.dev.lcip.org/console/clients">https://oauth-stable.dev.lcip.org/console/clients</a> (log with a
    @mozilla.com email))<br>
    <br>
    <br>
    All the steps are defined here:
<a class="moz-txt-link-freetext" href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/Firefox_Accounts/Introduction">https://developer.mozilla.org/en-US/docs/Mozilla/Tech/Firefox_Accounts/Introduction</a><br>
    <br>
    The login flow is the following:<br>
    <br>
    <ol>
      <li>You open a browser view with the Firefox Account login page
        asking for a list of scopes (in your case it might be <b>mozstumbler</b>)
        If you need the email you may ask <b>profile:email</b> as well</li>
      <ol>
        <li>You give a <b>state</b>, the <b>scope</b>s and your <b>client_id</b></li>
        <li>See
<a class="moz-txt-link-freetext" href="https://github.com/mozilla/fxa-oauth-server/blob/master/docs/api.md#get-v1authorization">https://github.com/mozilla/fxa-oauth-server/blob/master/docs/api.md#get-v1authorization</a><b><br>
          </b></li>
      </ol>
      <li>Then the user logs in and is redirected to your service with a
        <b>code</b> and a <b>state</b> (a session that you gave him)</li>
      <li>Then you talk to the Firefox Account server to exchange this
        code and state with a access token.</li>
      <ol>
        <li>See
<a class="moz-txt-link-freetext" href="https://github.com/mozilla/fxa-oauth-server/blob/master/docs/api.md#post-v1token">https://github.com/mozilla/fxa-oauth-server/blob/master/docs/api.md#post-v1token</a><br>
        </li>
      </ol>
      <li>This bearer token give you access to the FxA user id as well
        as the email if you need it.</li>
      <ol>
        <li><a class="moz-txt-link-freetext" href="https://github.com/mozilla/fxa-profile-server/blob/master/docs/API.md#get-v1email">https://github.com/mozilla/fxa-profile-server/blob/master/docs/API.md#get-v1email</a><br>
        </li>
      </ol>
      <li>You must also validate that this Bearer token have got the <b>mozstumbler</b>
        scope<br>
      </li>
    </ol>
    <br>
    Since you are in an Android app, you will need to setup a redirect
    url that will be catched by your app after the login so that you get
    back the code and state and can handle them. (See
    <a class="moz-txt-link-freetext" href="http://stackoverflow.com/a/2958870/186202">http://stackoverflow.com/a/2958870/186202</a>)<br>
    <br>
    Hope this helps you,<br>
    <br>
    Rémy<br>
    <br>
    <br>
    <div class="moz-cite-prefix">Le 19/05/2015 22:16, Victor Ng a
      écrit :<br>
    </div>
    <blockquote
cite="mid:CA+Ve98-agBCGqHJYJUrMHOYYH+G+7s7MKX4MEpc+KQNeNAVNew@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>Hi!<br>
            <br>
          </div>
          We'd like to look at getting FxA integration into the mozilla
          stumbler, but I'm pretty confused as to what I actually need
          to do.<br>
          <br>
        </div>
        <div>The use case we have is that we are launching localized
          leaderboards.  Basically - geographically scoped score
          boards.  <br>
          <br>
          The intent here is to login to the mobile application - not a
          particular web service.<br>
        </div>
        <div><br>
        </div>
        <div>The name of our app is "Mozilla Stumbler"<br>
          <br>
          We're running our dev leaderboard instance on : <a
            moz-do-not-send="true"
            href="http://ec2-52-1-93-147.compute-1.amazonaws.com">ec2-52-1-93-147.compute-1.amazonaws.com</a>
          , we can set the redirect_uri to whatever makes sense or is
          defacto standard for FxA.<br>
          <br>
        </div>
        <div><br>
        </div>
        <div>thanks!<br>
        </div>
        vic<br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Dev-fxacct mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Dev-fxacct@mozilla.org">Dev-fxacct@mozilla.org</a>
<a class="moz-txt-link-freetext" href="https://mail.mozilla.org/listinfo/dev-fxacct">https://mail.mozilla.org/listinfo/dev-fxacct</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>