<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Probably a bug in our impl.<br>
<br>
<div class="moz-cite-prefix">On 1/12/2016 3:45 AM, Ramon Rockx
wrote:<br>
</div>
<blockquote
cite="mid:CABfMt5dgdQq10J+fLd8LtfNGkM=HfvTar3yi2EHJc-P9gNpnaQ@mail.gmail.com"
type="cite">
<div dir="ltr">Hi all,<br>
<br>
Maybe someone can help me out with the following;<br>
I'm trying to secure my Jax-RS services with Keycloak
1.7.0.Final. I configured for this a client in Keycloak with
access type 'bearer-only'.<br>
Since I am using GlassFish 3.1 (no adapter available), I use the
'keycloak-servlet-filter-adapter'.<br>
When accessing one of the Jax-RS services with a valid token,
GlassFish will throw an exception (with no relevant info in it).
I debugged it, and found out that the <span
style="font-family:monospace,monospace">HttpServletRequestWrapper</span>,
which is returned by the servlet filter, has no <span
style="font-family:monospace,monospace">account</span>
property in it (see also <span
style="font-family:monospace,monospace">FilterSessionStore.buildWrapper(HttpSession,
KeycloakAccount)</span>). And when GlassFish will try to
access, for example the wrapper's principal, this will cause a
NPE.<br>
It seems that <span style="font-family:monospace,monospace">FilterRequestAuthenticator.completeBearerAuthentication(KeycloakPrincipal<RefreshableKeycloakSecurityContext>,
String)</span> does not store the <span
style="font-family:monospace,monospace">account</span> in the
<span style="font-family:monospace,monospace">tokenStore</span>.<br>
Should I use this feature differently? Or is access type
'bearer-only' simply not supported by the servlet filter?<br>
<br>
Thanks!<br>
<br>
Ramon Rockx</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
keycloak-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/keycloak-user">https://lists.jboss.org/mailman/listinfo/keycloak-user</a></pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Bill Burke
JBoss, a division of Red Hat
<a class="moz-txt-link-freetext" href="http://bill.burkecentral.com">http://bill.burkecentral.com</a></pre>
</body>
</html>