<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Dec 3, 2013 at 3:42 PM, Lucas Holmquist <span dir="ltr">&lt;<a href="mailto:lholmqui@redhat.com" target="_blank">lholmqui@redhat.com</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"><div class=""><div class="h5"><br>
On Dec 3, 2013, at 6:21 AM, Bruno Oliveira &lt;<a href="mailto:bruno@abstractj.org">bruno@abstractj.org</a>&gt; wrote:<br>
<br>
&gt; Hi Sebi, few comments inline.<br>
&gt;<br>
&gt; On December 3, 2013 at 8:54:22 AM, Sebastien Blanc (<a href="mailto:scm.blanc@gmail.com">scm.blanc@gmail.com</a>) wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hi,<br>
&gt;&gt; I wanted to start a fresh new thread about user management in the Unified<br>
&gt;&gt; Push Server, please check below the proposition I made for the next release<br>
&gt;&gt; (0.10.0) , feel free to comment / ask questions etc ...<br>
&gt;&gt;<br>
&gt;&gt; (<a href="https://gist.github.com/sebastienblanc/6547605" target="_blank">https://gist.github.com/sebastienblanc/6547605</a>)<br>
&gt;&gt; User Management for the Aerogear Unfied Push<br>
&gt;&gt; Server<br>
&gt;&gt; Introduction<br>
&gt;&gt;<br>
&gt;&gt; The goal of this document is to describe how the User Management will be<br>
&gt;&gt; implemented in the Unified Push Server. Currently there is only one user<br>
&gt;&gt; created by default when installing UPS. Having the possibility to create<br>
&gt;&gt; multiple users is a &quot;Must Have&quot; and should be manageable from the Admin<br>
&gt;&gt; Console. Some roles should also be introduced<br>
&gt;&gt; Roles /<br>
&gt;&gt; Permissions<br>
&gt;&gt;<br>
&gt;&gt; There will be 3 different roles in this first version :<br>
&gt;&gt;<br>
&gt;&gt; - *Admin* : The Admin is like the super-user, it can access all the<br>
&gt;&gt; features of UPS including the creation of users.<br>
&gt;&gt; - *Developer* : The developer can create/read/update and delete<br>
&gt;&gt; Applications/variants.<br>
&gt;&gt; - *viewer* : Can only &#39;Read&#39;, can be useful for monitoring apps (or for<br>
&gt;&gt; the future UPS Forge Plugin).<br>
&gt;<br>
&gt; Here the Developer role will be able to reset user’s password? Or his own password?<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; Role / actionCreateUpdateReadDeleteReset pwdUser MngtAdminXXXXXXDeveloperXXX<br>
&gt;&gt; XXViewer X<br>
&gt;&gt; User<br>
&gt;&gt; management flow<br>
&gt;&gt;<br>
&gt;&gt; An Admin can create new user by providing a loginName. This will be<br>
&gt;&gt; possible through :<br>
&gt;&gt;<br>
&gt;&gt; - The console<br>
&gt;&gt; - The REST service<br>
&gt;&gt;<br>
&gt;&gt; Password<br>
&gt;&gt; Management<br>
&gt;&gt;<br>
&gt;&gt; At creation, the user will have a default password , i.e 123.<br>
&gt;<br>
&gt; I think here is the problem which we can’t delay anymore. At the creation we should probably send an e-mail with the encrypted url for the password setup.<br>
&gt;<br>
&gt; Is not the same thing, but the url approach can be something similar to what SP does to register channels.<br>
<br>
</div></div>i&#39;m not sure we should put the email functionality in the UPS, but we could have a &quot;create a secure link&quot; option that the admin can then email out<br></blockquote><div><br></div><div style="font-family:arial,sans-serif;font-size:12.800000190734863px">
<br></div><div> </div><div><br></div><div style="font-family:arial,sans-serif;font-size:12.800000190734863px">Stop me if I&#39;m completely wrong but could we use our own cryptobox for this, I was thinking of this : <a href="https://github.com/aerogear/aerogear-crypto-java/blob/master/src/test/java/org/jboss/aerogear/crypto/CryptoBoxTest.java#L111" target="_blank">https://github.com/aerogear/aerogear-crypto-java/blob/master/src/test/java/org/jboss/aerogear/crypto/CryptoBoxTest.java#L111</a></div>
<div style="font-family:arial,sans-serif;font-size:12.800000190734863px"><br></div><div style="font-family:arial,sans-serif;font-size:12.800000190734863px">Which could be (again pardon my newbiness) : </div><div style="font-family:arial,sans-serif;font-size:12.800000190734863px">
<br></div><div style="font-family:arial,sans-serif;font-size:12.800000190734863px"><pre style="white-space:pre-wrap;line-height:12.800000190734863px;width:744px;font-size:12px;margin-bottom:0px;font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;margin-top:0px;padding:0px">
<div><span style="color:rgb(153,153,136);font-style:italic">//when generating the link</span></div><div><span style="color:rgb(51,51,51)">CryptoBox</span> <span style="color:rgb(51,51,51)">cryptoBox</span> <span style="font-weight:bold">=</span> <span style="font-weight:bold">new</span> <span style="color:rgb(51,51,51)">CryptoBox</span><span style="font-weight:bold">(</span><span style="font-weight:bold">new</span> <span style="color:rgb(51,51,51)">PrivateKey</span><span style="font-weight:bold">(</span><span style="color:rgb(51,51,51)">UPS_SECRET_KEY</span><span style="font-weight:bold">));</span></div>

<div><span style="color:rgb(68,85,136);font-weight:bold">byte</span><span style="font-weight:bold">[]</span> <span style="color:rgb(51,51,51)">IV</span> <span style="font-weight:bold">=</span> <span style="color:rgb(51,51,51)">HEX</span><span style="font-weight:bold">.</span><span style="color:teal">decode</span><span style="font-weight:bold">(</span><span style="color:rgb(51,51,51)">CRYPTOBOX_IV</span><span style="font-weight:bold">);</span></div>

<div><span style="color:rgb(68,85,136);font-weight:bold">byte</span><span style="font-weight:bold">[]</span> <span style="color:rgb(51,51,51)">cipherText</span> <span style="font-weight:bold">=</span> <span style="color:rgb(51,51,51)">cryptoBox</span><span style="font-weight:bold">.</span><span style="color:teal">encrypt</span><span style="font-weight:bold">(</span><span style="color:rgb(51,51,51)">IV</span><span style="font-weight:bold">,</span> <span style="color:rgb(51,51,51)">loginName</span><span style="font-weight:bold">.</span><span style="color:teal">getBytes</span><span style="font-weight:bold">());</span></div>

<div> </div><div><span style="font-weight:bold">return</span> <span style="color:rgb(221,17,68)">&quot;<a href="http://blabla/ag-push/register" target="_blank">http://blabla/ag-push/register</a>?&quot;</span> <span style="font-weight:bold">+</span> <span style="color:rgb(51,51,51)">cipherText</span><span style="font-weight:bold">;</span></div>

<div> </div><div> </div><div><span style="color:rgb(153,153,136);font-style:italic">//when the link is called</span></div>
<div><span style="color:rgb(51,51,51)">CryptoBox</span> <span style="color:rgb(51,51,51)">pandora</span> <span style="font-weight:bold">=</span> <span style="font-weight:bold">new</span> <span style="color:rgb(51,51,51)">CryptoBox</span><span style="font-weight:bold">(</span><span style="font-weight:bold">new</span> <span style="color:rgb(51,51,51)">PrivateKey</span><span style="font-weight:bold">(</span><span style="color:rgb(51,51,51)">UPS_SECRET_KEY</span><span style="font-weight:bold">));</span></div>

<div><span style="color:rgb(68,85,136);font-weight:bold">byte</span><span style="font-weight:bold">[]</span> <span style="color:rgb(51,51,51)">message</span> <span style="font-weight:bold">=</span> <span style="color:rgb(51,51,51)">pandora</span><span style="font-weight:bold">.</span><span style="color:teal">decrypt</span><span style="font-weight:bold">(</span><span style="color:rgb(51,51,51)">IV</span><span style="font-weight:bold">,</span> <span style="color:rgb(51,51,51)">cipherText</span><span style="font-weight:bold">);</span></div>

<div><span style="color:rgb(51,51,51)">String</span> <span style="color:rgb(51,51,51)">loginName</span> <span style="font-weight:bold">=</span> <span style="color:rgb(51,51,51)">RAW</span><span style="font-weight:bold">.</span><span style="color:teal">encode</span><span style="font-weight:bold">(</span><span style="color:rgb(51,51,51)">message</span><span style="font-weight:bold">);</span></div>
 </pre></div><div><span style="color:rgb(153,153,136);font-style:italic;font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;line-height:12.800000190734863px;white-space:pre-wrap">//Do stuff with the loginName</span> </div>
<div><br></div><div><br></div><div style>Then the question is about the private key,  how do I store it / generate it ? Should I use the Java Keystore class <a href="http://docs.oracle.com/javase/7/docs/api/java/security/KeyStore.html">http://docs.oracle.com/javase/7/docs/api/java/security/KeyStore.html</a> ? </div>
<div style><br></div><div style><br></div><div style><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">

<div class=""><div class="h5"><br>
&gt;<br>
&gt;&gt; First Login<br>
&gt;&gt;<br>
&gt;&gt; When logging in for this first time, the new created user will be prompted<br>
&gt;&gt; to change his password.<br>
&gt;<br>
&gt; Same thing there, I think users should be able to reset their own password.<br>
&gt;<br>
&gt;&gt; Reset<br>
&gt;&gt; Password Instruction<br>
&gt;&gt;<br>
&gt;&gt; If a user wants to reset his password, he has to request it manually<br>
&gt;&gt; (email, post pigeon ...) to an admin. The password will be again the<br>
&gt;&gt; default one and the user will have to change it again when logging in.<br>
&gt;&gt; Scope<br>
&gt;&gt; of the current permissions<br>
&gt;&gt;<br>
&gt;&gt; Currently, a authenticated user can see all the applications / variants /<br>
&gt;&gt; installations, no matter he is the author or not. There is also no concept<br>
&gt;&gt; of groups, that may come in the future releases.<br>
&gt;&gt; Security<br>
&gt;&gt; Implementation<br>
&gt;&gt;<br>
&gt;&gt; Currently, it would be possible to implement this using<br>
&gt;&gt; Aerogear-Security-Picketlink and with some raw Picketlink :<br>
&gt;&gt;<br>
&gt;&gt; - Login / Logout / Registration : AG-Security offers all we need<br>
&gt;&gt; - Roles and permissions : AG-Security offers a secures annotation that<br>
&gt;&gt; can be used to protect the endpoints.<br>
&gt;&gt;<br>
&gt;&gt; I know there are some concerns about this last points (Role escalation etc<br>
&gt;&gt; ...) and would like to have advice / feedback on what is acceptable /<br>
&gt;&gt; doable for the 0.10.0 release (15/01).<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; aerogear-dev mailing list<br>
&gt;&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
&gt;&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; abstractj<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>
</div></div></blockquote></div><br></div></div>