<div dir="ltr">Hi all,<br><br>Maybe someone can help me out with the following;<br>I&#39;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 &#39;bearer-only&#39;.<br>Since I am using GlassFish 3.1 (no adapter available), I use the &#39;keycloak-servlet-filter-adapter&#39;.<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&#39;s principal, this will cause a NPE.<br>It seems that <span style="font-family:monospace,monospace">FilterRequestAuthenticator.completeBearerAuthentication(KeycloakPrincipal&lt;RefreshableKeycloakSecurityContext&gt;, 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 &#39;bearer-only&#39; simply not supported by the servlet filter?<br><br>Thanks!<br><br>Ramon Rockx</div>