<div dir="ltr"><div><div>I&#39;ve moved bootstrap of the angular to the authenticated (as suggested by Stian),</div><div>that seems to be a cleaner solution:</div><div><br></div><div>instead of</div><div><br></div><div>...?permanent_login=XYZ/#/main</div>


<div><br></div><div>we get just this URL:</div><div><br></div><div>.../#/main</div><div><br></div><div><a href="https://github.com/sebastienblanc/aerogear-unified-push-server/pull/1" target="_blank">https://github.com/sebastienblanc/aerogear-unified-push-server/pull/1</a></div>


</div><div><br></div><div><br></div><div>----</div><div><br></div>The issue with NPE still persists:<div><br></div><div><a href="http://lists.jboss.org/pipermail/keycloak-dev/2014-June/001934.html" target="_blank">http://lists.jboss.org/pipermail/keycloak-dev/2014-June/001934.html</a></div>


<div><br><div><a href="https://issues.jboss.org/browse/KEYCLOAK-523" target="_blank">https://issues.jboss.org/browse/KEYCLOAK-523</a><br></div><div><br></div></div><div><br></div><div><br></div><div class="gmail_extra"><br>

<br><div class="gmail_quote">
On Mon, Jun 9, 2014 at 6:05 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


Ahoy and thank you.<br>
<br>
I was looking and testing your latest changes, in the very beginning of<br>
this integration I also tried to include Angular.js&#39; interceptors and<br>
all the Angular-isms available.<br>
<br>
The problem is the fact of hiding the probable bug. If you change the<br>
endpoint to something like:<br>
<br>
@GET<br>
@Produces(MediaType.APPLICATION_JSON)<br>
public Response listAllPushApplications(@Context<br>
  HttpServletRequest request) {<br>
    return Response.ok(pushAppService.findAllPushApplicationsForDeveloper(&quot;admin&quot;)).build();<br>
}<br>
<br>
or<br>
<br>
@GET<br>
@Produces(MediaType.APPLICATION_JSON)<br>
public Response listAllPushApplications(@Context<br>
  HttpServletRequest request) {<br>
    return Response.ok(&quot;guacamole&quot;).build();<br>
}<br>
<br>
The issue still persists. I&#39;ll keep investigating.<br>
<div><div><br>
<br>
On 2014-06-07, Sebastien Blanc wrote:<br>
&gt; Hi my friend !<br>
&gt;<br>
&gt; Just to let you know I started to look at your branch and indeed you better<br>
&gt; not be epileptic to survive the crazy reloads ;)<br>
&gt; I have nothing to push right now but I have some ideas :<br>
&gt;<br>
&gt; * Like you mention, the redirect and main route broke the stuff. So, I<br>
&gt; think we should remove that and do the initial redirect in the success<br>
&gt; callback of the keycloakAuth.init call. I have a local branch where I<br>
&gt; manage to do that, but it&#39;s really hacky and I face another issue , the<br>
&gt; first next REST call fails because there are not auth info. But ! This is<br>
&gt; there where we have to introduce the Auth interceptor like here<br>
&gt; <a href="https://github.com/keycloak/keycloak/blob/master/examples/demo-template/angular-product-app/src/main/webapp/js/app.js#L43-L60" target="_blank">https://github.com/keycloak/keycloak/blob/master/examples/demo-template/angular-product-app/src/main/webapp/js/app.js#L43-L60</a><br>



&gt;<br>
&gt; I think based on this, we should be able to find a solution. I will try to<br>
&gt; push my work ASAP and maybe some dudes for KC could give us some hints as<br>
&gt; well.<br>
&gt;<br>
&gt; Have a good weekend !<br>
&gt;<br>
&gt; sebi<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Fri, Jun 6, 2014 at 6:05 PM, Bruno Oliveira &lt;<a href="mailto:bruno@abstractj.org" target="_blank">bruno@abstractj.org</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt; Good morning,<br>
&gt; &gt;<br>
&gt; &gt; I&#39;m struggling to integrate Keycloak.js with our admin-ui. Everything<br>
&gt; &gt; works perfectly well out of admin-ui with UPS and Angular.js as you<br>
&gt; &gt; might notice here:<br>
&gt; &gt;<br>
&gt; &gt; <a href="https://github.com/abstractj/aerogear-unifiedpush-server/tree/keycloak-angular" target="_blank">https://github.com/abstractj/aerogear-unifiedpush-server/tree/keycloak-angular</a><br>
&gt; &gt;<br>
&gt; &gt; The issue lies when I enable the routes related with redirect and<br>
&gt; &gt; MainController:<br>
&gt; &gt;<br>
&gt; &gt; <a href="https://github.com/abstractj/aerogear-unifiedpush-server/tree/keycloak_angular_integration" target="_blank">https://github.com/abstractj/aerogear-unifiedpush-server/tree/keycloak_angular_integration</a><br>



&gt; &gt; .<br>
&gt; &gt; Just open <a href="http://localhost:8080/ag-push" target="_blank">http://localhost:8080/ag-push</a> and watch your browser reload<br>
&gt; &gt; like crazy. When the main route and redirect are disable, everything goes<br>
&gt; &gt; well:<br>
&gt; &gt;<br>
&gt; &gt; <a href="https://github.com/abstractj/aerogear-unifiedpush-server/commit/dd9438c6503061fba8aa0e0d77973971888e9379" target="_blank">https://github.com/abstractj/aerogear-unifiedpush-server/commit/dd9438c6503061fba8aa0e0d77973971888e9379</a><br>



&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; At first glance it doesn&#39;t sound to be a problem on KC.js, once already<br>
&gt; &gt; works with Angular.js:<br>
&gt; &gt;<br>
&gt; &gt; <a href="https://github.com/keycloak/keycloak/tree/master/examples/demo-template/angular-product-app" target="_blank">https://github.com/keycloak/keycloak/tree/master/examples/demo-template/angular-product-app</a><br>



&gt; &gt; .<br>
&gt; &gt;<br>
&gt; &gt; If you have any idea, help is appreciated.<br>
&gt; &gt;<br>
&gt; &gt; --<br>
&gt; &gt;<br>
&gt; &gt; abstractj<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; aerogear-dev mailing list<br>
&gt; &gt; <a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">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; &gt;<br>
<br>
&gt; _______________________________________________<br>
&gt; aerogear-dev mailing list<br>
&gt; <a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">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>
--<br>
<br>
abstractj<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>
</div></div></blockquote></div><br></div></div>