<div dir="ltr"><div>Hi, Firefox Team,</div><div><br></div><div>I hate being annoying, any information on the e-mail below will be really helpful, as I tried everything what I could come up with</div><div><br></div>Thank you in advance,<div>Alex K.<br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 8, 2015 at 10:15 PM, Oleksandr Kyetov <span dir="ltr"><<a href="mailto:oleksandr.kyetov@gmail.com" target="_blank">oleksandr.kyetov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span style="font-size:12.8000001907349px">Guys, thatns you for response,</span><div><div class="h5"><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">It really helped me a lot, and I let myself play a little with:</div><div style="font-size:12.8000001907349px"><a href="https://github.com/mozilla/fxa-oauth-server" target="_blank">https://github.com/mozilla/fxa-oauth-server</a></div><div style="font-size:12.8000001907349px"><a href="https://github.com/mozilla/fxa-auth-server" target="_blank">https://github.com/mozilla/fxa-auth-server</a></div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">But, unfortunately it is not quite what I need</div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">My context is next:</div><div style="font-size:12.8000001907349px">1) There is no client UI at all</div><div style="font-size:12.8000001907349px">2) I have Firefox Account credentials stored in the backend</div><div style="font-size:12.8000001907349px">3) Backend written via NodeJS</div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">The flow is next:</div><div style="font-size:12.8000001907349px">1) Something  call backend server;</div><div style="font-size:12.8000001907349px">2) fxa-auth-server endpoint <a href="https://github.com/mozilla/fxa-auth-server/blob/master/docs/api.md#post-v1accountlogin" target="_blank">https://github.com/mozilla/fxa-auth-server/blob/master/docs/api.md#post-v1accountlogin</a> called, which returns session token</div><div style="font-size:12.8000001907349px">3) Hawk credentials is derived from session token received in step 2)</div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">What I can do using Hawk credentials from step 3):</div><div style="font-size:12.8000001907349px">4a) Call <a href="https://github.com/mozilla/fxa-auth-server/blob/master/docs/api.md#get-v1sessionstatus" target="_blank">https://github.com/mozilla/fxa-auth-server/blob/master/docs/api.md#get-v1sessionstatus</a> to get session status</div><div style="font-size:12.8000001907349px">5b) Call <a href="https://github.com/mozilla/fxa-auth-server/blob/master/docs/api.md#post-v1sessiondestroy" target="_blank">https://github.com/mozilla/fxa-auth-server/blob/master/docs/api.md#post-v1sessiondestroy</a> to destroy session</div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">What I want be able to do using Hawk credentials from step 3)</div><div style="font-size:12.8000001907349px"><div>4b) Call <a href="https://docs.services.mozilla.com/loop/apis.html#post-call-url" target="_blank">https://docs.services.mozilla.com/loop/apis.html#post-call-url</a> to get call url</div><div>But the only thing I receive from Loop Server:</div><div><div><font size="1">{</font></div><div><font size="1"><span style="white-space:pre-wrap">  </span>"code": 401,</font></div><div><font size="1"><span style="white-space:pre-wrap">       </span>"errno": 110,</font></div><div><font size="1"><span style="white-space:pre-wrap">      </span>"error": {</font></div><div><font size="1"><span style="white-space:pre-wrap">         </span>"statusCode": 401,</font></div><div><font size="1"><span style="white-space:pre-wrap">         </span>"error": "Unauthorized",</font></div><div><font size="1"><span style="white-space:pre-wrap">         </span>"message": "Unknown credentials"</font></div><div><font size="1"><span style="white-space:pre-wrap"> </span>}</font></div><div><font size="1">}</font></div></div><div><br></div><div>So I here are more concrete questions:</div><div>- is it even possible to call <a href="https://docs.services.mozilla.com/loop/apis.html#post-call-url" target="_blank">https://docs.services.mozilla.com/loop/apis.html#post-call-url</a> with hawk credentials derived from session token recieved from <a href="https://github.com/mozilla/fxa-auth-server/blob/master/docs/api.md#post-v1accountlogin" target="_blank">https://github.com/mozilla/fxa-auth-server/blob/master/docs/api.md#post-v1accountlogin</a>?</div><div>- if it is possible - what I am doing wrong?</div><div>- if it is not possible - what are other ways? (except FxA OAuth)</div><div><br></div><div>P.S. I create test application to give an idea what I am doing: <a href="https://github.com/oleksandrkyetov/test-app-server" target="_blank">https://github.com/oleksandrkyetov/test-app-server</a></div><div><br>Thanks in advance,</div><div>Alex K.</div></div></div></div></div>
</blockquote></div><br></div></div></div>