<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jun 19, 2013 at 9:29 AM, Sebastien Blanc <span dir="ltr">&lt;<a href="mailto:scm.blanc@gmail.com" target="_blank">scm.blanc@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">FYI,<div><br></div><div>A &quot;security&quot; <span style="font-family:arial,sans-serif;font-size:12.800000190734863px">Java Sender branch has also been pushed : </span><a href="https://github.com/aerogear/aerogear-unified-push-java-client/tree/security" target="_blank">https://github.com/aerogear/aerogear-unified-push-java-client/tree/security</a></div>

<div>It&#39;s using preemptive Basic Http Authentification but we will switch to a more &quot;classic&quot; flow when AGPUSH-99 will be resolved.</div><div><br></div><div>Like Matthias said is &quot;all in progress&quot; work but &quot;Push early, Push often&quot;</div>
</div></blockquote><div><br></div><div style>exactly  </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">
<div><br></div><div><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jun 19, 2013 at 8:38 AM, Christos Vasilakis <span dir="ltr">&lt;<a href="mailto:cvasilak@gmail.com" target="_blank">cvasilak@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">looks great!<div><br></div><div><div><div><div><div>On Jun 17, 2013, at 3:52 PM, Matthias Wessendorf &lt;<a href="mailto:matzew@apache.org" target="_blank">matzew@apache.org</a>&gt; wrote:</div>

<br></div></div><blockquote type="cite"><div><div><div dir="ltr"><p style="margin-right:0px;margin-bottom:15px;margin-left:0px;font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:15.454545021057129px;line-height:22.727272033691406px;margin-top:0px!important">


Hi,</p><p style="margin:15px 0px;font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:15.454545021057129px;line-height:22.727272033691406px">I worked a bit on the initial security, after Bruno release the 1.0.1 versions of AG-Security.</p>


<h2 style="margin:1em 0px 15px;padding:0px;font-size:2em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);font-family:Helvetica,arial,freesans,clean,sans-serif"><a name="13f5b56ea7354473_13f5b28476d2635e_management-of-pushapplications-and-mobilevariants" href="https://gist.github.com/anonymous/b82b7bb1b2d1ab36f92d#management-of-pushapplications-and-mobilevariants" style="color:rgb(65,131,196);text-decoration:none;display:block;padding-left:30px" target="_blank"><span></span></a>Management of PushApplications and MobileVariants</h2>

<p style="margin:15px 0px;font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:15.454545021057129px;line-height:22.727272033691406px">Adding a (simple) <em>DEVELOPER</em> class (just that, no <em>fancy</em> roles yet).<br>


This is powered by AG-Security and the very wellknown &quot;login&quot;/&quot;logout&quot; will be used (and soon &quot;enroll&quot; for new users).</p><p style="margin:15px 0px;font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:15.454545021057129px;line-height:22.727272033691406px">


A <em>DEVELOPER</em> is allowed to create/manage PushApplications and MobileVariants (including the standard CRUD flow).</p><p style="margin:15px 0px;font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:15.454545021057129px;line-height:22.727272033691406px">


Here is a little cURL based flow:</p><h4 style="margin:1em 0px 15px;padding:0px;font-size:1.2em;font-family:Helvetica,arial,freesans,clean,sans-serif"><a name="13f5b56ea7354473_13f5b28476d2635e_login" href="https://gist.github.com/anonymous/b82b7bb1b2d1ab36f92d#login" style="color:rgb(65,131,196);text-decoration:none;display:block;padding-left:30px" target="_blank"><span></span></a>Login:</h4>


<pre style="font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:13px;line-height:19px;margin-top:15px;margin-bottom:15px;background-color:rgb(248,248,248);border:1px solid rgb(221,221,221);overflow:auto;padding:6px 10px;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">
<code style="font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;line-height:normal;margin:0px;padding:0px;border:none;background-color:transparent;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">curl -v -b cookies.txt -c cookies.txt
  -H &quot;Accept: application/json&quot; -H &quot;Content-type: application/json&quot;
  -X POST 
  -d &#39;{&quot;loginName&quot;: &quot;admin&quot;, &quot;password&quot;:&quot;123&quot;}&#39;
<a href="http://localhost:8080/ag-push/rest/auth/login" target="_blank">http://localhost:8080/ag-push/rest/auth/login</a>
</code></pre><h4 style="margin:1em 0px 15px;padding:0px;font-size:1.2em;font-family:Helvetica,arial,freesans,clean,sans-serif"><a name="13f5b56ea7354473_13f5b28476d2635e_create-new-pushapp" href="https://gist.github.com/anonymous/b82b7bb1b2d1ab36f92d#create-new-pushapp" style="color:rgb(65,131,196);text-decoration:none;display:block;padding-left:30px" target="_blank"><span></span></a>Create new PushApp:</h4>


<pre style="font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:13px;line-height:19px;margin-top:15px;margin-bottom:15px;background-color:rgb(248,248,248);border:1px solid rgb(221,221,221);overflow:auto;padding:6px 10px;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">
<code style="font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;line-height:normal;margin:0px;padding:0px;border:none;background-color:transparent;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">curl -v -b cookies.txt -c cookies.txt -v 
  -H &quot;Accept: application/json&quot; -H &quot;Content-type: application/json&quot; 
  -X POST 
  -d &#39;{&quot;name&quot; : &quot;MyApp&quot;, &quot;description&quot; :  &quot;awesome app&quot; }&#39;
<a href="http://localhost:8080/ag-push/rest/applications" target="_blank">http://localhost:8080/ag-push/rest/applications</a>
</code></pre><h4 style="margin:1em 0px 15px;padding:0px;font-size:1.2em;font-family:Helvetica,arial,freesans,clean,sans-serif"><a name="13f5b56ea7354473_13f5b28476d2635e_create-variant-here-simplepush-for-it" href="https://gist.github.com/anonymous/b82b7bb1b2d1ab36f92d#create-variant-here-simplepush-for-it" style="color:rgb(65,131,196);text-decoration:none;display:block;padding-left:30px" target="_blank"><span></span></a>Create Variant (here SimplePush) for it:</h4>


<pre style="font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:13px;line-height:19px;margin-top:15px;margin-bottom:15px;background-color:rgb(248,248,248);border:1px solid rgb(221,221,221);overflow:auto;padding:6px 10px;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">
<code style="font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;line-height:normal;margin:0px;padding:0px;border:none;background-color:transparent;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">curl -v -b cookies.txt -c cookies.txt -v 
  -H &quot;Accept: application/json&quot; -H &quot;Content-type: application/json&quot; 
  -X POST 
  -d &#39;{&quot;pushNetworkURL&quot; : &quot;<a href="http://localhost:7777/endpoint/" target="_blank">http://localhost:7777/endpoint/</a>&quot;}&#39;
<a href="http://localhost:8080/ag-push/rest/applications/%7BPUSH_APP_ID%7D/simplePush" target="_blank">http://localhost:8080/ag-push/rest/applications/{PUSH_APP_ID}/simplePush</a>
</code></pre><h2 style="margin:1em 0px 15px;padding:0px;font-size:2em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);font-family:Helvetica,arial,freesans,clean,sans-serif">
<a name="13f5b56ea7354473_13f5b28476d2635e_sending-push-notifications" href="https://gist.github.com/anonymous/b82b7bb1b2d1ab36f92d#sending-push-notifications" style="color:rgb(65,131,196);text-decoration:none;display:block;padding-left:30px" target="_blank"><span></span></a>Sending Push Notifications</h2>

<p style="margin:15px 0px;font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:15.454545021057129px;line-height:22.727272033691406px">When a PushApplication is created, it will get a GENERATED <em>PUSH-APP-ID</em> (like before) and it will also have a generated <em>master secret</em>. For sending (NOW) you need HTTP BASIC auth against the SENDER HTTP interface:</p>


<pre style="font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:13px;line-height:19px;margin-top:15px;margin-bottom:15px;background-color:rgb(248,248,248);border:1px solid rgb(221,221,221);overflow:auto;padding:6px 10px;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">
<code style="font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;line-height:normal;margin:0px;padding:0px;border:none;background-color:transparent;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">curl -u &quot;{PushApplicationID}:{MasterSecret}&quot;
   -v -H &quot;Accept: application/json&quot; -H &quot;Content-type: application/json&quot; 
   -X POST
   -d &#39;{&quot;key&quot;:&quot;value&quot;, &quot;alert&quot;:&quot;HELLO!&quot;, &quot;sound&quot;:&quot;default&quot;, &quot;badge&quot;:7,
       &quot;simple-push&quot;:&quot;version=123&quot;}&#39;

<a href="http://localhost:8080/ag-push/rest/sender/broadcast" target="_blank">http://localhost:8080/ag-push/rest/sender/broadcast</a>
</code></pre><p style="margin:15px 0px;font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:15.454545021057129px;line-height:22.727272033691406px">The user is a combination of PushApplicationID:MasterSecret, hence no need to include the PushApplicationID on the URL.....</p>


<h2 style="margin:1em 0px 15px;padding:0px;font-size:2em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);font-family:Helvetica,arial,freesans,clean,sans-serif"><a name="13f5b56ea7354473_13f5b28476d2635e_device-registration" href="https://gist.github.com/anonymous/b82b7bb1b2d1ab36f92d#device-registration" style="color:rgb(65,131,196);text-decoration:none;display:block;padding-left:30px" target="_blank"><span></span></a>Device Registration</h2>

<p style="margin:15px 0px;font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:15.454545021057129px;line-height:22.727272033691406px">When a MobileVariant is created, it will get a GENERATED <em>VARIANT-ID</em> (like before) and it will have a generated &quot;variant secret&quot; (valid ONLY!!! for that variant). Now a device needs to perform HTTP basic against that server, in order to register itself:</p>

<p style="margin:15px 0px;font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:15.454545021057129px;line-height:22.727272033691406px">An Android (cURL) example:</p><pre style="font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:13px;line-height:19px;margin-top:15px;margin-bottom:15px;background-color:rgb(248,248,248);border:1px solid rgb(221,221,221);overflow:auto;padding:6px 10px;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">
<code style="font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;line-height:normal;margin:0px;padding:0px;border:none;background-color:transparent;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">curl -u &quot;{MobileVariantID}:{secret}&quot;
   -v -H &quot;Accept: application/json&quot; -H &quot;Content-type: application/json&quot; 
   -X POST
   -d &#39;{
      &quot;deviceToken&quot; : &quot;someTokenString&quot;, 
      &quot;deviceType&quot; : &quot;ANDROID&quot;, 
      &quot;mobileOperatingSystem&quot; : &quot;android&quot;, 
      &quot;osVersion&quot; : &quot;4.0.1&quot;
    }&#39;

<a href="http://localhost:8080/ag-push/rest/registry/device" target="_blank">http://localhost:8080/ag-push/rest/registry/device</a> 
</code></pre><p style="margin:15px 0px;font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:15.454545021057129px;line-height:22.727272033691406px">The user is a combination of MobileVariantID:MasterSecret, hence no need to include the MobileVariantID (was a http header in the past).</p>

<p style="margin:15px 0px"><font face="Helvetica, arial, freesans, clean, sans-serif"><span style="font-size:15.454545021057129px;line-height:22.727272033691406px">The work lives on a branch for now:</span></font><br>
<font face="Helvetica, arial, freesans, clean, sans-serif"><span style="font-size:15px;line-height:22.71875px"><a href="https://github.com/aerogear/aerogear-unified-push-server/tree/endpoint-security" target="_blank">https://github.com/aerogear/aerogear-unified-push-server/tree/endpoint-security</a></span></font><br>


</p><p style="margin:15px 0px;font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:15.454545021057129px;line-height:22.727272033691406px"><br></p><p style="margin-top:15px;margin-right:0px;margin-left:0px;font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:15.454545021057129px;line-height:22.727272033691406px;margin-bottom:0px!important">


FYI, the iOS SDK has been updated to reflect that: <a href="https://github.com/matzew/aerogear-push-ios-registration/commit/ef8001684c38144b5a8fb05abbb87d0ddf452b07" style="color:rgb(65,131,196);text-decoration:none" target="_blank">https://github.com/matzew/aerogear-push-ios-registration/commit/ef8001684c38144b5a8fb05abbb87d0ddf452b07</a></p>


<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>
_______________________________________________<br>aerogear-dev mailing list<br><a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">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></blockquote>

</div><br></div></div><br>_______________________________________________<br>
aerogear-dev mailing list<br>
<a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">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></blockquote></div><br></div>
</div></div><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></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>