<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 2, 2013 at 3:14 PM, Bruno Oliveira <span dir="ltr">&lt;<a href="mailto:bruno@abstractj.org" target="_blank">bruno@abstractj.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Answers inline.<br>
<div class="im"><br>
Matthias Wessendorf wrote:<br>
&gt; Hi Bruno,<br>
&gt;<br>
&gt;<br>
&gt; On Tue, Jul 2, 2013 at 11:48 AM, Bruno Oliveira &lt;<a href="mailto:bruno@abstractj.org">bruno@abstractj.org</a><br>
</div><div class="im">&gt; &lt;mailto:<a href="mailto:bruno@abstractj.org">bruno@abstractj.org</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     Good morning everyone, I&#39;m planning to include JWS (to add digital<br>
&gt;     signatures per mobile application)/JWT (to issue a token at each<br>
&gt;     transaction or session) support on AeroGear and I was looking at OAuth2<br>
&gt;     bearer token (which make use of JWT/JWS behind the scenes)<br>
&gt;     implementation from RESTEasy.<br>
&gt;<br>
&gt;     I was reading about how to properly include it and now we have a<br>
&gt;     decision to make (we because it will affect the way the client side and<br>
&gt;     security is not an island :). RESTEasy bearer tokens is completely tied<br>
&gt;     to JBoss<br>
&gt;     (<a href="http://docs.jboss.org/resteasy/docs/3.0.1.Final/userguide/html/oauth2.html#d4e1446" target="_blank">http://docs.jboss.org/resteasy/docs/3.0.1.Final/userguide/html/oauth2.html#d4e1446</a>)<br>
&gt;     and I&#39;m not saying it is a bad thing, but with vert.x, TorqueBox,<br>
&gt;     Nodej...I&#39;m not sure if it&#39;s a good idea.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; That is because of (from the requirements): &quot;A username/password based<br>
&gt; JBoss security domain&quot;, right?<br>
&gt;<br>
<br>
</div>Nope. This comes from the requirement &quot;add security to AG&quot; :)<br></blockquote><div><br></div><div style>I was more asking about the &quot;completely tied to JBoss&quot; note.</div><div style><br></div><div style>
Is that because of &quot;...based JBoss security domain&quot; ? </div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

Username/Password are cool, the goal here is to add token between<br>
client/server.<br>
<br>
This token will come with timestamp, in this way if someone<br>
eavesdropping your connection steal your username/password, the token<br>
will be required.<br>
<div class="im"><br>
&gt;<br>
&gt;     An example of Bearer Token usage extracted from RFC<br>
&gt;     (<a href="http://tools.ietf.org/html/rfc6750" target="_blank">http://tools.ietf.org/html/rfc6750</a>)<br>
&gt;<br>
&gt;            HTTP/1.1 200 OK<br>
&gt;            Content-Type: application/json;charset=UTF-8<br>
&gt;            Cache-Control: no-store<br>
&gt;            Pragma: no-cache<br>
&gt;<br>
&gt;            {<br>
&gt;     &quot;access_token&quot;:&quot;mF_9.B5f-4.1JqM&quot;,<br>
&gt;     &quot;token_type&quot;:&quot;Bearer&quot;,<br>
&gt;     &quot;expires_in&quot;:3600,<br>
&gt;     &quot;refresh_token&quot;:&quot;tGzv3JOkF0XG5Qx2TlKWIA&quot;<br>
&gt;            }<br>
&gt;<br>
&gt;     Pros: RESTEasy team already did it<br>
&gt;     Cons: The configuration setup might be hard to newcomers (please look at<br>
&gt;     the documentation<br>
&gt;     <a href="http://docs.jboss.org/resteasy/docs/3.0.1.Final/userguide/html/oauth2.html#d4e1446" target="_blank">http://docs.jboss.org/resteasy/docs/3.0.1.Final/userguide/html/oauth2.html#d4e1446</a>),<br>
&gt;     we will be tied to JBoss.<br>
&gt;<br>
&gt;     So, do we have an alternative? Yes.<br>
&gt;<br>
&gt;<br>
&gt; good :-)<br>
&gt;<br>
&gt;     Make use of JWT module only from<br>
&gt;     RESTEasy<br>
&gt;<br>
&gt;<br>
&gt; you mean only the JWT(==JSON Web Token) - not the &quot;bearer token&quot; ?<br>
<br>
</div>Yes.<br></blockquote><div><br></div><div style>Ok</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div class="im"><br>
&gt;<br>
&gt;     and we still can benefit of digital signatures and tokens.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; The digital signatures would be still JWS (==JSON Web Signature) ?<br>
<br>
</div>Yup, to avoid confusion:<br>
<br>
- JSON Web signatures: can be used to sign http requests against the<br>
server  (do not replace the certificate) and avoid DDoS against the<br>
server, non repudiation<br></blockquote><div><br></div><div style>sounds good </div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<br>
- JSON Web token: another security layer (OPTIONAL). If for some reason<br>
SSL was misconfigured, broken....you still have this layer of security<br>
(this token is time-based, &quot;MACed&quot; and irreversible).<br>
<div class="im"><br>
&gt;<br>
&gt;<br>
&gt;     An example of JWT usage extracted from RFC<br>
&gt;     (<a href="http://tools.ietf.org/html/draft-jones-json-web-token-10#page-6" target="_blank">http://tools.ietf.org/html/draft-jones-json-web-token-10#page-6</a>)<br>
&gt;<br>
&gt;     {<br>
&gt;     &quot;iss&quot;:&quot;joe&quot;,<br>
&gt;     &quot;exp&quot;:1300819380,<br>
&gt;     &quot;<a href="http://example.com/is_root" target="_blank">http://example.com/is_root</a>&quot;:true<br>
&gt;     }<br>
&gt;<br>
&gt;     Pros: Flexibility, we have people already doing it<br>
&gt;     (<a href="https://wiki.mozilla.org/WebAPI/WebPayment" target="_blank">https://wiki.mozilla.org/WebAPI/WebPayment</a>).<br>
&gt;<br>
&gt;<br>
&gt; So our &quot;client side&quot; hook could be basically used with that WebPayment<br>
&gt; thing, right ?<br>
<br>
</div>No.<br>
<br>
Sorry, I should explain that better, this is just an example. We will<br>
not make use of WebPayment API, this is a snippet from Mozilla (I was<br>
giving the credit, instead of just cut &amp; paste. And also showing an<br>
example where JWT is used).<br></blockquote><div><br></div><div style>:-) I was expecting we are not using the WebPayment.</div><div style><br></div><div style>Perhaps my question was stupid - let me try again.</div><div style>
If we have the JWT (e.g. on AG-JavaScript), could our bits could be used</div><div style>against a WebPayment Server ? (not sure if tehre is something).</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<br>
Into our project will be just JWT/JWS implementation with the RESTEasy<br>
module.<br></blockquote><div><br></div><div style>And since that is &quot;wrapped&quot; by AG-Security, it&#39;s not really tied to JBoss, since<br></div><div style>we could have other &quot;adapters&quot;, e.g. for Nodej/vert.x ? <br>
</div><div style><br></div><div style><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div class="im"><br>
&gt;<br>
&gt;     We will make use of<br>
&gt;     RESTEasy module and do not reinvent the wheel.<br>
&gt;<br>
&gt;<br>
&gt; +1 on reusing existing code. Not sure I fully understand (see my above<br>
&gt; comments on JWS/JWT :)<br>
<br>
</div>Feel free to ask, sorry for my bad explanation.<br></blockquote><div><br></div><div style>I guess we are getting there :) </div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div class="im"><br>
&gt;<br>
&gt;<br>
&gt;     Cons: The authorization model must be implemented and adapted to our<br>
&gt;     needs<br>
&gt;<br>
&gt;<br>
&gt; That could be done on-top of what we already have for AeroGear Security ?<br>
<br>
</div>Yup, that&#39;s the idea.<br>
<div class="im">&gt;<br>
&gt;<br>
&gt; -Matthias<br>
&gt;<br>
&gt;<br>
&gt;     So what do you think?<br>
&gt;<br>
&gt;     ps: SAML is not an option for me now.<br>
&gt;<br>
&gt;     --<br>
&gt;     abstractj<br>
&gt;<br>
&gt;     _______________________________________________<br>
&gt;     aerogear-dev mailing list<br>
</div>&gt;     <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a>&gt;<br>
<div class=""><div class="h5">&gt;     <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Matthias Wessendorf<br>
&gt;<br>
&gt; blog: <a href="http://matthiaswessendorf.wordpress.com/" target="_blank">http://matthiaswessendorf.wordpress.com/</a><br>
&gt; sessions: <a href="http://www.slideshare.net/mwessendorf" target="_blank">http://www.slideshare.net/mwessendorf</a><br>
&gt; twitter: <a href="http://twitter.com/mwessendorf" target="_blank">http://twitter.com/mwessendorf</a><br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; aerogear-dev mailing list<br>
&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
<br>
--<br>
abstractj<br>
<br>
_______________________________________________<br>
aerogear-dev mailing list<br>
<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Matthias Wessendorf <br><br>blog: <a href="http://matthiaswessendorf.wordpress.com/" target="_blank">http://matthiaswessendorf.wordpress.com/</a><br>
sessions: <a href="http://www.slideshare.net/mwessendorf" target="_blank">http://www.slideshare.net/mwessendorf</a><br>twitter: <a href="http://twitter.com/mwessendorf" target="_blank">http://twitter.com/mwessendorf</a>
</div></div>