<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Thanks for the back and forth guys. This helped me understand the questions I didn't even know I needed to ask! ;)</div><div><br></div><div>+1 from me as well</div><div><br>On Jul 2, 2013, at 9:43, Matthias Wessendorf &lt;<a href="mailto:matzew@apache.org">matzew@apache.org</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 2, 2013 at 4:35 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">Ahoy<br>
<div class="im"><br>
Matthias Wessendorf wrote:<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; On Tue, Jul 2, 2013 at 11:48 AM, Bruno Oliveira<br>
&gt; &nbsp; &nbsp; &lt;<a href="mailto:bruno@abstractj.org">bruno@abstractj.org</a> &lt;mailto:<a href="mailto:bruno@abstractj.org">bruno@abstractj.org</a>&gt;<br>
</div><div class="im">&gt; &nbsp; &nbsp; &nbsp;&gt; &lt;mailto:<a href="mailto:bruno@abstractj.org">bruno@abstractj.org</a> &lt;mailto:<a href="mailto:bruno@abstractj.org">bruno@abstractj.org</a>&gt;&gt;&gt; wrote:<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; &nbsp; &nbsp; Good morning everyone, I'm planning to include JWS (to add<br>
&gt; &nbsp; &nbsp; digital<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; &nbsp; &nbsp; signatures per mobile application)/JWT (to issue a token at each<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; &nbsp; &nbsp; transaction or session) support on AeroGear and I was looking<br>
&gt; &nbsp; &nbsp; at OAuth2<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; &nbsp; &nbsp; bearer token (which make use of JWT/JWS behind the scenes)<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; &nbsp; &nbsp; implementation from RESTEasy.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; &nbsp; &nbsp; I was reading about how to properly include it and now we have a<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; &nbsp; &nbsp; decision to make (we because it will affect the way the<br>
&gt; &nbsp; &nbsp; client side and<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; &nbsp; &nbsp; security is not an island :). RESTEasy bearer tokens is<br>
&gt; &nbsp; &nbsp; completely tied<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; &nbsp; &nbsp; to JBoss<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; (<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; &nbsp; &nbsp; &nbsp;&gt; &nbsp; &nbsp; and I'm not saying it is a bad thing, but with vert.x, TorqueBox,<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; &nbsp; &nbsp; Nodej...I'm not sure if it's a good idea.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; That is because of (from the requirements): "A username/password<br>
&gt; &nbsp; &nbsp; based<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; JBoss security domain", right?<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; Nope. This comes from the requirement "add security to AG" :)<br>
&gt;<br>
&gt;<br>
&gt; I was more asking about the "completely tied to JBoss" note.<br>
&gt;<br>
&gt; Is that because of "...based JBoss security domain" ?<br>
<br>
</div>Gotcha and yes. You must to setup security constraints on JBoss for it<br>
<a href="http://docs.jboss.org/resteasy/docs/3.0.1.Final/userguide/html/oauth2.html#d4e1657" target="_blank">http://docs.jboss.org/resteasy/docs/3.0.1.Final/userguide/html/oauth2.html#d4e1657</a><br>
and quoting the documentation "You must though use FORM authentication"<br>
(<a href="http://docs.jboss.org/resteasy/docs/3.0.1.Final/userguide/html/oauth2.html#d4e1654" target="_blank">http://docs.jboss.org/resteasy/docs/3.0.1.Final/userguide/html/oauth2.html#d4e1654</a>)<br>
<br>
I'm not saying this is wrong, is just the framework design.<br></blockquote><div><br></div><div style="">Ah...! :) Thanks for the iterations here :) &nbsp;But yes, I agree that we do not want this!</div><div style="">So a late +1 on your original statement :) &nbsp;</div>
<div style=""><br></div><div style=""><br></div><div style=""><br></div><div style=""><br></div><div><br></div><div><br></div><div>&nbsp;</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><div class="h5"><br>
&gt;<br>
&gt; &nbsp; &nbsp; Username/Password are cool, the goal here is to add token between<br>
&gt; &nbsp; &nbsp; client/server.<br>
&gt;<br>
&gt; &nbsp; &nbsp; This token will come with timestamp, in this way if someone<br>
&gt; &nbsp; &nbsp; eavesdropping your connection steal your username/password, the token<br>
&gt; &nbsp; &nbsp; will be required.<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; &nbsp; &nbsp; An example of Bearer Token usage extracted from RFC<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; &nbsp; &nbsp; (<a href="http://tools.ietf.org/html/rfc6750" target="_blank">http://tools.ietf.org/html/rfc6750</a>)<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;HTTP/1.1 200 OK<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Content-Type: application/json;charset=UTF-8<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Cache-Control: no-store<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Pragma: no-cache<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; "access_token":"mF_9.B5f-4.1JqM",<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; "token_type":"Bearer",<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; "expires_in":3600,<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; "refresh_token":"tGzv3JOkF0XG5Qx2TlKWIA"<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; &nbsp; &nbsp; Pros: RESTEasy team already did it<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; &nbsp; &nbsp; Cons: The configuration setup might be hard to newcomers<br>
&gt; &nbsp; &nbsp; (please look at<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; &nbsp; &nbsp; the documentation<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; <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; &nbsp; &nbsp; &nbsp;&gt; &nbsp; &nbsp; we will be tied to JBoss.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; &nbsp; &nbsp; So, do we have an alternative? Yes.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; good :-)<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; &nbsp; &nbsp; Make use of JWT module only from<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; &nbsp; &nbsp; RESTEasy<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; you mean only the JWT(==JSON Web Token) - not the "bearer token" ?<br>
&gt;<br>
&gt; &nbsp; &nbsp; Yes.<br>
&gt;<br>
&gt;<br>
&gt; Ok<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; &nbsp; &nbsp; and we still can benefit of digital signatures and tokens.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; The digital signatures would be still JWS (==JSON Web Signature) ?<br>
&gt;<br>
&gt; &nbsp; &nbsp; Yup, to avoid confusion:<br>
&gt;<br>
&gt; &nbsp; &nbsp; - JSON Web signatures: can be used to sign http requests against the<br>
&gt; &nbsp; &nbsp; server &nbsp;(do not replace the certificate) and avoid DDoS against the<br>
&gt; &nbsp; &nbsp; server, non repudiation<br>
&gt;<br>
&gt;<br>
&gt; sounds good<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; - JSON Web token: another security layer (OPTIONAL). If for some reason<br>
&gt; &nbsp; &nbsp; SSL was misconfigured, broken....you still have this layer of security<br>
&gt; &nbsp; &nbsp; (this token is time-based, "MACed" and irreversible).<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; &nbsp; &nbsp; An example of JWT usage extracted from RFC<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; &nbsp; &nbsp; (<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; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; &nbsp; &nbsp; {<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; "iss":"joe",<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; "exp":1300819380,<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; "<a href="http://example.com/is_root" target="_blank">http://example.com/is_root</a>":true<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; &nbsp; &nbsp; }<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; &nbsp; &nbsp; Pros: Flexibility, we have people already doing it<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; &nbsp; &nbsp; (<a href="https://wiki.mozilla.org/WebAPI/WebPayment" target="_blank">https://wiki.mozilla.org/WebAPI/WebPayment</a>).<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; So our "client side" hook could be basically used with that<br>
&gt; &nbsp; &nbsp; WebPayment<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; thing, right ?<br>
&gt;<br>
&gt; &nbsp; &nbsp; No.<br>
&gt;<br>
&gt; &nbsp; &nbsp; Sorry, I should explain that better, this is just an example. We will<br>
&gt; &nbsp; &nbsp; not make use of WebPayment API, this is a snippet from Mozilla (I was<br>
&gt; &nbsp; &nbsp; giving the credit, instead of just cut &amp; paste. And also showing an<br>
&gt; &nbsp; &nbsp; example where JWT is used).<br>
&gt;<br>
&gt;<br>
&gt; :-) I was expecting we are not using the WebPayment.<br>
&gt;<br>
&gt; Perhaps my question was stupid - let me try again.<br>
&gt; If we have the JWT (e.g. on AG-JavaScript), could our bits could be used<br>
&gt; against a WebPayment Server ? (not sure if tehre is something).<br>
<br>
</div></div>There are no stupid questions, it must be clear to everybody. For<br>
authentication and digital signatures I would say, yes.<br></blockquote><div><br></div><div><br></div><div style="">that's cool&nbsp;</div><div>&nbsp;</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>
For transactions I doubt it, because they have specific requirements not<br>
present on AeroGear like: &nbsp;pricePoint, icons, productData.......(also<br>
not present into the specification)<br></blockquote><div><br></div><div><br></div><div style="">yeah, agree - I was more interested in the "digital&nbsp;signatures" part&nbsp;</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; &nbsp; &nbsp; Into our project will be just JWT/JWS implementation with the RESTEasy<br>
&gt; &nbsp; &nbsp; module.<br>
&gt;<br>
&gt;<br>
&gt; And since that is "wrapped" by AG-Security, it's not really tied to<br>
&gt; JBoss, since<br>
&gt; we could have other "adapters", e.g. for Nodej/vert.x ?<br>
<br>
</div>That's the idea. </blockquote><div><br></div><div style="">sound good. &nbsp;Again +1 on the overall idea, and thanks for explaining!</div><div style=""><br></div><div style="">&nbsp;<br></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">
As far as I know this RESTEasy module is not CDI<br>
dependent, so I'd say it's possible.<br></blockquote><div><br></div><div style="">@Dependent :)&nbsp;</div><div style=""><br></div><div style="">I do not know, but good luck :)&nbsp;</div><div>&nbsp;</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;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; &nbsp; &nbsp; We will make use of<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; &nbsp; &nbsp; RESTEasy module and do not reinvent the wheel.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; +1 on reusing existing code. Not sure I fully understand (see my<br>
&gt; &nbsp; &nbsp; above<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; comments on JWS/JWT :)<br>
&gt;<br>
&gt; &nbsp; &nbsp; Feel free to ask, sorry for my bad explanation.<br>
&gt;<br>
&gt;<br>
&gt; I guess we are getting there :)<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; &nbsp; &nbsp; Cons: The authorization model must be implemented and adapted<br>
&gt; &nbsp; &nbsp; to our<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; &nbsp; &nbsp; needs<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; That could be done on-top of what we already have for AeroGear<br>
&gt; &nbsp; &nbsp; Security ?<br>
&gt;<br>
&gt; &nbsp; &nbsp; Yup, that's the idea.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; -Matthias<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
<br>
<br>
</div><div class=""><div class="h5">--<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>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>aerogear-dev mailing list</span><br><span><a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a></span><br><span><a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a></span></div></blockquote></body></html>