<div dir="ltr">Hey guys,<div><br></div><div>I just looked at the login mechanism and the communication between the admin console and the backend in the alpha 2 release again. If I&#39;m not mistaken, you used to use HTTP-only for the <span style="color:rgb(48,57,66);font-family:Menlo,monospace;font-size:11px;white-space:pre-wrap">KEYCLOAK_SAAS_IDENTITY </span>cookie. Did something change about that in alpha 2? When I look at the HTTP requests in the chrome developer console, I don&#39;t see the HttpOnly flag anywhere.</div>
<div><br></div><div>Cheers,</div><div>Nils</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jan 30, 2014 at 5:23 PM, Stian Thorgersen <span dir="ltr">&lt;<a href="mailto:stian@redhat.com" target="_blank">stian@redhat.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 class="HOEnZb"><div class="h5"><br>
<br>
----- Original Message -----<br>
&gt; From: &quot;Bill Burke&quot; &lt;<a href="mailto:bburke@redhat.com">bburke@redhat.com</a>&gt;<br>
&gt; To: <a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a><br>
&gt; Sent: Thursday, 30 January, 2014 3:46:52 PM<br>
&gt; Subject: Re: [keycloak-user] Keycloak and OAuth 2.0 Resource Owner Password Credentials Grant<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On 1/30/2014 9:29 AM, Nils Preusker wrote:<br>
&gt; &gt; Hey Bill, thanks for the clarification, I didn&#39;t realize that the cookie<br>
&gt; &gt; was Http-only, neat!<br>
&gt; &gt;<br>
&gt; &gt; We are building a pure HTML5 client that is also hosted separately from<br>
&gt; &gt; the REST-backends. The thing is that we use a reverse proxy so for the<br>
&gt; &gt; browser it all looks like one app since everything comes from different<br>
&gt; &gt; paths in the same domain.<br>
&gt; &gt;<br>
&gt; &gt; I&#39;ll try to clarify the last part of my last mail: We are currently<br>
&gt; &gt; using org.jboss.resteasy.skeleton.key.as7.OAuthAuthenticationServerValve<br>
&gt; &gt; (skeleton-key-as7) in our REST-backend modules. If I&#39;m not mistaken,<br>
&gt; &gt; some parts of the code base and concepts are the same as in keycloak,<br>
&gt; &gt; right?<br>
&gt; &gt;<br>
&gt; &gt; So far, in the AngularJS application we&#39;ve been adding bearer tokens to<br>
&gt; &gt; the HTTP Authorization header. Since the backend uses JAX-RS/ RestEasy,<br>
&gt; &gt; the verification of the bearer tokens was done transparently by<br>
&gt; &gt; OAuthAuthenticationServerValve and RESTEasy automatically added the<br>
&gt; &gt; roles etc. to the HttpServletRequest. Now in the REST backend of the<br>
&gt; &gt; admin app in keycloak you&#39;re doing the same thing (validating the tokens<br>
&gt; &gt; and extracting the roles) manually with the AuthenticationManager<br>
&gt; &gt; (authenticateSaasIdentityCookie(...)). So I was just wondering whether<br>
&gt; &gt; you are planning to make that process more transparent in the future?<br>
&gt; &gt;<br>
&gt;<br>
&gt; We&#39;re doing it manually because the original idea was that the admin<br>
&gt; service could manage multiple organizations  (a SaaS), so you&#39;d have to<br>
&gt; set up the cookie path&#39;s correctly.<br>
&gt;<br>
&gt; For your app, it sounds like @RolesAllowed will work.  You just have to<br>
&gt; set up the appropriate web.xml security constraints for your REST urls<br>
&gt; in web.xml.  Just set up the REST apis to require authentication and let<br>
&gt; @RolesAllowed do the rest.  The keycloak jboss/wildfly adapter can<br>
&gt; handle BEARER token auth at the same time as regular browser oauth.  If<br>
&gt; the server is initiating the login, then you can just follow the current<br>
&gt; keycloak examples.  If not, then the Javascript lib Stian wrote is an<br>
&gt; option (and something we&#39;ll have to document).<br>
<br>
</div></div>JS lib needs a bit of work as well, if it&#39;s something you want I can make it a priority<br>
<div class="HOEnZb"><div class="h5"><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Bill Burke<br>
&gt; JBoss, a division of Red Hat<br>
&gt; <a href="http://bill.burkecentral.com" target="_blank">http://bill.burkecentral.com</a><br>
&gt; _______________________________________________<br>
&gt; keycloak-user mailing list<br>
&gt; <a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/keycloak-user" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a><br>
&gt;<br>
_______________________________________________<br>
keycloak-user mailing list<br>
<a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/keycloak-user" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a><br>
</div></div></blockquote></div><br></div>