<div dir="ltr">Hey Stian, thanks for the link, that&#39;s exactly what I was looking for!</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jan 29, 2014 at 5:53 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">Have a look at:<br>
<br>
<a href="https://github.com/keycloak/keycloak/blob/master/testsuite/integration/src/test/java/org/keycloak/testsuite/OAuthClient.java#L146" target="_blank">https://github.com/keycloak/keycloak/blob/master/testsuite/integration/src/test/java/org/keycloak/testsuite/OAuthClient.java#L146</a><br>

<div class="HOEnZb"><div class="h5"><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: Wednesday, 29 January, 2014 4:05:58 PM<br>
&gt; Subject: Re: [keycloak-user] Verifying Bearer Tokens in Vert.x<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On 1/29/2014 10:58 AM, Nils Preusker wrote:<br>
&gt; &gt; Hi everybody,<br>
&gt; &gt;<br>
&gt; &gt; we are developing an application that consists of several REST<br>
&gt; &gt; web-applications written with different application frameworks (Java EE<br>
&gt; &gt; 6/ JBoss AS and Vert.x). So far we are<br>
&gt; &gt; using org.jboss.resteasy.skeleton.key.as7.OAuthAuthenticationServerValve<br>
&gt; &gt; from the skelton-key-as7 template (which as far as I can see, keycloak<br>
&gt; &gt; is based on?) as an OAuth provider and just add bearer tokens to the<br>
&gt; &gt; authentication headers of the HTTP requests between the modules.<br>
&gt; &gt;<br>
&gt; &gt; One of the really nice features for us is that the role mapping of users<br>
&gt; &gt; is included in the tokens (which is also described in the keycloak docs<br>
&gt; &gt; with a reference to JSON Web Tokens).<br>
&gt; &gt;<br>
&gt; &gt; Now the modules that are deployed to JBoss AS transparently verify the<br>
&gt; &gt; bearer tokens and RESTEasy even takes care of adding the username and<br>
&gt; &gt; the user roles to the HttpServletRequest which also allows us to use<br>
&gt; &gt; @RolesAllowed (very convenient!).<br>
&gt; &gt;<br>
&gt; &gt; What I&#39;m wondering now is whether there is an easy way of adding<br>
&gt; &gt; validation and decoding of bearer tokens to Vert.x modules. Ideally, I<br>
&gt; &gt; would like to be able to add a jar dependency that provides me with a<br>
&gt; &gt; few methods to validate the token (make sure it is a real token, hasn&#39;t<br>
&gt; &gt; been modified and didn&#39;t expire...) and extract the user and roles from<br>
&gt; &gt; it. Since a private key is needed, I guess I would add a json config<br>
&gt; &gt; file or even just pass the required values to the API directly.<br>
&gt; &gt;<br>
&gt;<br>
&gt; Don&#39;t know anything about vert.x, but if you use the keycloak-core<br>
&gt; module, it has all the code needed to unmarshal and verify the token.<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>