<div dir="ltr">Hi Bill,<div><br></div><div>I&#39;m not sure if you&#39;ve had a chance to review my previous message, so I thought I ping you again.  Would you let me know what else I can do as I have followed the documentation and still can&#39;t seem to get this working inside of an ear file which contains both the war and jars (contains the EJB files).</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 21, 2016 at 10:14 AM, Firdos Ali <span dir="ltr">&lt;<a href="mailto:ali@affordabletours.com" target="_blank">ali@affordabletours.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 bgcolor="white" lang="EN-US" link="blue" vlink="purple"><div><span class=""><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">Thank you and I hope that your meetings went well.   I already had that in place when I read the documentation which is why it was really odd to see it not work.  <a name="m_-4061408185559759715__MailEndCompose">Below is my server.xml file:<u></u><u></u></a></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"><u></u> <u></u></span></p></span><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">&lt;?xml version=&#39;1.0&#39; encoding=&#39;UTF-8&#39;?&gt;<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">&lt;server xmlns=&quot;urn:jboss:domain:2.0&quot;&gt;<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">    &lt;extensions&gt;<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">                                . . .<u></u><u></u></span></p><span class=""><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">        &lt;extension module=&quot;org.keycloak.keycloak-adapter-subsystem&quot;/&gt;<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">    &lt;/extensions&gt;<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">                <u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">                &lt;profile&gt;<u></u><u></u></span></p></span><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">                                &lt;subsystem xmlns=&quot;urn:jboss:domain:ejb3:2.0&quot;&gt;<u></u><u></u></span></p><span class=""><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">                                                . . .<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">                                                &lt;default-security-domain value=&quot;keycloak&quot;/&gt; &lt;!-- Added to ensure that the default security domain is only keycloak, but this does not work either --&gt;<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">                                                . . .<u></u><u></u></span></p></span><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">                                &lt;/subsystem&gt;<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">                <u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">        &lt;subsystem xmlns=&quot;urn:jboss:domain:security:1.2&quot;&gt;<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">                                                . . .<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">            &lt;security-domains&gt;<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">                                                                 &lt;security-domain name=&quot;keycloak&quot;&gt;<u></u><u></u></span></p><span class=""><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">                    &lt;authentication&gt;<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">                        &lt;login-module code=&quot;org.keycloak.adapters.jboss.KeycloakLoginModule&quot; flag=&quot;required&quot;/&gt;<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">                    &lt;/authentication&gt;<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">                &lt;/security-domain&gt;<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">                                                &lt;/security-domains&gt;<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">                                &lt;/subsystem&gt;<u></u><u></u></span></p></span><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">                                . . .<u></u><u></u></span></p><span class=""><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">                                &lt;subsystem xmlns=&quot;urn:jboss:domain:keycloak:1.1&quot;&gt;<u></u><u></u></span></p></span><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">            &lt;secure-deployment name=&quot;atweb.war&quot;&gt;<u></u><u></u></span></p><span class=""><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">                &lt;realm&gt;affordabletours&lt;/realm&gt;<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">                &lt;resource&gt;atoms&lt;/resource&gt;<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">                &lt;realm-public-key&gt;...&lt;/realm-public-key&gt;<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">                &lt;auth-server-url&gt;<a href="http://10.0.0.2:8080/auth" target="_blank">http://10.0.0.2:8080/auth</a>&lt;/auth-server-url&gt;<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">                &lt;ssl-required&gt;EXTERNAL&lt;/ssl-required&gt;<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">                &lt;credential name=&quot;secret&quot;&gt;some secret&lt;/credential&gt;<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">            &lt;/secure-deployment&gt;<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">        &lt;/subsystem&gt;<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">&lt;/server&gt;<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"><u></u> <u></u></span></p></span><div><div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0in 0in 0in"><p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:windowtext">From:</span></b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:windowtext"> <a href="mailto:keycloak-user-bounces@lists.jboss.org" target="_blank">keycloak-user-bounces@lists.jboss.org</a> [mailto:<a href="mailto:keycloak-user-bounces@lists.jboss.org" target="_blank">keycloak-user-bounces@lists.jboss.org</a>] <b>On Behalf Of </b>Bill Burke<span class=""><br><b>Sent:</b> Monday, March 21, 2016 9:56 AM<br></span><b>To:</b> <a href="mailto:keycloak-user@lists.jboss.org" target="_blank">keycloak-user@lists.jboss.org</a></span></p><div><div class="h5"><br><b>Subject:</b> Re: [keycloak-user] EJB Invalid User + Log Out not working<u></u><u></u></div></div><p></p></div></div><div><div class="h5"><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal" style="margin-bottom:12.0pt">Sorry for late response.  We were all traveling last week for face to face meetings.<br><br>Check out this:<br><br><a href="http://keycloak.github.io/docs/userguide/keycloak-server/html/ch08.html#jboss-adapter" target="_blank">http://keycloak.github.io/docs/userguide/keycloak-server/html/ch08.html#jboss-adapter</a><br><br>Look for KeycloakLoginModule  You have to set this up in order to propagate between component layers.  I wish we didn&#39;t have to require this extra step, but its just a falacy of the current Wildfly security architecture.<u></u><u></u></p><div><p class="MsoNormal">On 3/18/2016 10:31 AM, Firdos Ali wrote:<u></u><u></u></p></div><blockquote style="margin-top:5.0pt;margin-bottom:5.0pt"><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">The EJB is called from the server-side web app.  This is a legacy app using Struts, so after the user logs in from keycloak they are redirected back to the webapp.  The web application has access to the user, however the EJB does not find a user and throws back the error.</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">I have the following in my jboss-web.xml:</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">&lt;jboss-web&gt;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">&lt;security-domain&gt;java:/jaas/keycloak&lt;/security-domain&gt;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">&lt;/jboss-web&gt;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">I have the following in my jboss-ejb3.xml:</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">&lt;jboss:ejb-jar</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">        xmlns=</span><a href="http://java.sun.com/xml/ns/javaee" target="_blank"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">&quot;http://java.sun.com/xml/ns/javaee&quot;</span></a><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">        xmlns:jboss=</span><a href="http://www.jboss.com/xml/ns/javaee" target="_blank"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">&quot;http://www.jboss.com/xml/ns/javaee&quot;</span></a><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">        xmlns:xsi=</span><a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span></a><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">        xmlns:s=&quot;urn:security:1.1&quot;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">        version=&quot;3.1&quot; impl-version=&quot;2.0&quot;&gt;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">    &lt;assembly-descriptor&gt;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">        &lt;s:security&gt;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">            &lt;ejb-name&gt;*&lt;/ejb-name&gt;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">            &lt;s:security-domain&gt;keycloak&lt;/s:security-domain&gt;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">            &lt;s:run-as-principal&gt;&lt;/s:run-as-principal&gt;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">            &lt;s:missing-method-permissions-deny-access&gt;true&lt;/s:missing-method-permissions-deny-access&gt;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">        &lt;/s:security&gt;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">    &lt;/assembly-descriptor&gt;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">&lt;/jboss:ejb-jar&gt;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif"> Stian Thorgersen [</span><a href="mailto:sthorger@redhat.com" target="_blank"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">mailto:sthorger@redhat.com</span></a><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">] <br><b>Sent:</b> Friday, March 18, 2016 7:05 AM<br><b>To:</b> Firdos Ali </span><a href="mailto:ali@affordabletours.com" target="_blank"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">&lt;ali@affordabletours.com&gt;</span></a><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif"><br><b>Cc:</b> keycloak-user </span><a href="mailto:keycloak-user@lists.jboss.org" target="_blank"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">&lt;keycloak-user@lists.jboss.org&gt;</span></a><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">; Stian Thorgersen </span><a href="mailto:stian@redhat.com" target="_blank"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">&lt;stian@redhat.com&gt;</span></a><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif"><br><b>Subject:</b> RE: [keycloak-user] EJB Invalid User + Log Out not working</span><u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p>How is the ejb being called? &gt;From jax-rs service or server-side web app? For there to be a user you need to be authenticated as a user so either the server-side webapp has redirected to login page or there is a bearer token included in the authorisation header of the http request.<u></u><u></u></p><p class="MsoNormal">On 15 Mar 2016 17:58, &quot;Firdos Ali&quot; &lt;<a href="mailto:ali@affordabletours.com" target="_blank">ali@affordabletours.com</a>&gt; wrote:<u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">Thank you for the prompt response.</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">I moved to keycloak 1.9.1 both on the server and updated the adapter, however it is still not working.  Let me clarify on a few other things and hopefully that will provide some additional context</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">We put our project in an ear file which contains one jar file inclusive of the stateless ejbs, one war file, and a few other supporting jar files.  </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">The war file has the keycloak.json with the following:</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">{</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">  &quot;realm&quot;: &quot;affordabletours&quot;,</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">  &quot;realm-public-key&quot;: &quot;some key&quot;,</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">  &quot;auth-server-url&quot;: &quot;</span><a href="http://10.0.0.1:8080/auth" target="_blank"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">http://10.0.0.1:8080/auth</span></a><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">&quot;,</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">  &quot;ssl-required&quot;: &quot;external&quot;,</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">  &quot;resource&quot;: &quot;keycloaktest&quot;,</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">  &quot;credentials&quot;: {</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">    &quot;secret&quot;: &quot;some secret&quot;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">  }</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">}</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">Are you suggesting that I change the resource “keycloaktest” access type from ‘confidential’ to ‘bearer-only’?  If so, I tried that and unfortunately that did not work.  I guess my confusion is how would the jar file with the ejbs is aware of the security context when it is only at the war level?   Thanks</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><a name="m_-4061408185559759715_-279217427159260115__MailEndCompose"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"> </span></a><u></u><u></u></p><p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif"> Stian Thorgersen [mailto:</span><a href="mailto:sthorger@redhat.com" target="_blank"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">sthorger@redhat.com</span></a><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">] <br><b>Sent:</b> Friday, March 11, 2016 12:29 AM<br><b>To:</b> Firdos Ali &lt;</span><a href="mailto:ali@affordabletours.com" target="_blank"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">ali@affordabletours.com</span></a><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">&gt;<br><b>Cc:</b> keycloak-user &lt;</span><a href="mailto:keycloak-user@lists.jboss.org" target="_blank"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">keycloak-user@lists.jboss.org</span></a><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">&gt;<br><b>Subject:</b> Re: [keycloak-user] EJB Invalid User + Log Out not working</span><u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><div><p class="MsoNormal">On 10 March 2016 at 20:19, Firdos Ali &lt;<a href="mailto:ali@affordabletours.com" target="_blank">ali@affordabletours.com</a>&gt; wrote:<u></u><u></u></p><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt"><div><div><p class="MsoNormal">Hello,<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">I am having a few problems with Keycloak.  Let me first start with the environment information:<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">Keycloak version: 1.9.0<u></u><u></u></p><p class="MsoNormal">Keycloak wildfly version: 10.0.0<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">Application wildfly version: 8.0.0<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal"><b>Problem 1: EJB error - javax.ejb.EJBAccessException: JBAS013323: Invalid User</b><u></u><u></u></p><p class="MsoNormal">I have followed the documentation by adding the keycloak adapter to the application wildfly 8.0 and by server.xml has the following:<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">&lt;extensions&gt;<br>       ….<br>        &lt;extension module=&quot;org.keycloak.keycloak-adapter-subsystem&quot;/&gt;<br>&lt;/extensions&gt;<u></u><u></u></p><p class="MsoNormal">&lt;profile&gt;<br>        &lt;subsystem xmlns=&quot;urn:jboss:domain:security:1.2&quot;&gt;<br>                ….<br>            &lt;security-domain name=&quot;keycloak&quot;&gt;<br>                    &lt;authentication&gt;<br>                        &lt;login-module code=&quot;org.keycloak.adapters.jboss.KeycloakLoginModule&quot; flag=&quot;required&quot;/&gt;<br>                    &lt;/authentication&gt;<br>                &lt;/security-domain&gt;<br>            &lt;/security-domains&gt;<br>        &lt;/subsystem&gt;<br>       …<br>        &lt;subsystem xmlns=&quot;urn:jboss:domain:keycloak:1.1&quot;/&gt;<br>&lt;/profile&gt;<u></u><u></u></p><p class="MsoNormal" style="text-autospace:none">MyEJB:<br><span style="font-size:10.0pt;font-family:Consolas;color:#646464">@Stateless</span><u></u><u></u></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:#646464">@Local</span><span style="font-size:10.0pt;font-family:Consolas">(MyInt.</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7f0055">class</span></b><span style="font-size:10.0pt;font-family:Consolas">)</span><u></u><u></u></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:#646464">@SecurityDomain</span><span style="font-size:10.0pt;font-family:Consolas">(</span><span style="font-size:10.0pt;font-family:Consolas;color:#2a00ff">&quot;keycloak&quot;</span><span style="font-size:10.0pt;font-family:Consolas">)<br></span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7f0055">public</span></b><span style="font-size:10.0pt;font-family:Consolas"> </span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7f0055">class</span></b><span style="font-size:10.0pt;font-family:Consolas"> MyBean </span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7f0055">implements</span></b><span style="font-size:10.0pt;font-family:Consolas"> MyInt </span><u></u><u></u></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">       ...</span><u></u><u></u></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:#646464">    @PermitAll</span><u></u><u></u></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">    </span><span style="font-size:10.0pt;font-family:Consolas;color:#646464">@TransactionAttribute</span><span style="font-size:10.0pt;font-family:Consolas">(TransactionAttributeType.</span><b><i><span style="font-size:10.0pt;font-family:Consolas;color:#0000c0">REQUIRES_NEW</span></i></b><span style="font-size:10.0pt;font-family:Consolas">)</span><u></u><u></u></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">    </span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7f0055">public</span></b><span style="font-size:10.0pt;font-family:Consolas"> boolean myMethod(...) </span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7f0055">throws</span></b><span style="font-size:10.0pt;font-family:Consolas"> Exception {</span><u></u><u></u></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">    }</span><u></u><u></u></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas"> </span><u></u><u></u></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">At the moment I am not using jboss-ej3.xml as I reference the security domain in my EJB class.  I added it and it did not help out</span><u></u><u></u></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas"> </span><u></u><u></u></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">Stacktrace:</span><u></u><u></u></p><p class="MsoNormal" style="text-autospace:none">ERROR [org.jboss.as.ejb3.invocation] (default task-13) JBAS014134: EJB Invocation failed on component MyBean for method public abstract boolean com.at.ejb.MyInt.myMethod(…) throws java.lang.Exception: javax.ejb.EJBAccessException: JBAS013323: Invalid User<u></u><u></u></p><p class="MsoNormal" style="text-autospace:none">        at org.jboss.as.ejb3.security.SecurityContextInterceptor$1.run(SecurityContextInterceptor.java:66) [wildfly-ejb3-8.0.0.Final.jar:8.0.0.Final]<u></u><u></u></p><p class="MsoNormal" style="text-autospace:none">        at org.jboss.as.ejb3.security.SecurityContextInterceptor$1.run(SecurityContextInterceptor.java:46) [wildfly-ejb3-8.0.0.Final.jar:8.0.0.Final]<u></u><u></u></p><p class="MsoNormal" style="text-autospace:none">        at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:92) [wildfly-ejb3-8.0.0.Final.jar:8.0.0.Final]<u></u><u></u></p><p class="MsoNormal" style="text-autospace:none">        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)<u></u><u></u></p><p class="MsoNormal" style="text-autospace:none">        at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64) [wildfly-ejb3-8.0.0.Final.jar:8.0.0.Final]<u></u><u></u></p><p class="MsoNormal" style="text-autospace:none">        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)<u></u><u></u></p><p class="MsoNormal" style="text-autospace:none">        at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [wildfly-ejb3-8.0.0.Final.jar:8.0.0.Final]<u></u><u></u></p><p class="MsoNormal" style="text-autospace:none">        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)<u></u><u></u></p><p class="MsoNormal" style="text-autospace:none">        at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)<u></u><u></u></p><p class="MsoNormal" style="text-autospace:none">        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)<u></u><u></u></p><p class="MsoNormal" style="text-autospace:none">        at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:55) [wildfly-ejb3-8.0.0.Final.jar:8.0.0.Final]<u></u><u></u></p><p class="MsoNormal" style="text-autospace:none">        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)<u></u><u></u></p><p class="MsoNormal" style="text-autospace:none">        at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)<u></u><u></u></p><p class="MsoNormal" style="text-autospace:none">        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)<u></u><u></u></p><p class="MsoNormal" style="text-autospace:none">        at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)<u></u><u></u></p><p class="MsoNormal" style="text-autospace:none">        at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:448)<u></u><u></u></p><p class="MsoNormal" style="text-autospace:none">        at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)<u></u><u></u></p><p class="MsoNormal" style="text-autospace:none">        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)<u></u><u></u></p><p class="MsoNormal" style="text-autospace:none">        at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)<u></u><u></u></p><p class="MsoNormal" style="text-autospace:none">        at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)<u></u><u></u></p><p class="MsoNormal" style="text-autospace:none">        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)<u></u><u></u></p><p class="MsoNormal" style="text-autospace:none">        at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)<u></u><u></u></p><p class="MsoNormal" style="text-autospace:none">        at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:185)<u></u><u></u></p><p class="MsoNormal" style="text-autospace:none">        at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:182)<u></u><u></u></p><p class="MsoNormal" style="text-autospace:none">        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)<u></u><u></u></p><p class="MsoNormal">Is there something I am missing from the documentation?  Any thoughts how to resolve this issue?<u></u><u></u></p></div></div></blockquote><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal">Is there a bearer token sent with the request that invokes the EJB? If so try with 1.9.1. Could be <a href="https://issues.jboss.org/browse/KEYCLOAK-2518" target="_blank">https://issues.jboss.org/browse/KEYCLOAK-2518</a> fixes this.<u></u><u></u></p></div><div><p class="MsoNormal"> <u></u><u></u></p></div><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt"><div><div><p class="MsoNormal"><b>Problem 2: Unable to log out a user from keycloak administration console:</b><u></u><u></u></p><p class="MsoNormal">After I click “Logout” on the administration console in Keycloak, I see the following error on the keycloak server:<u></u><u></u></p><p class="MsoNormal">ERROR [io.undertow.request] (default task-26) UT005023: Exception handling request to /auth/admin/realms/affordabletours/sessions/f1e69f90-03fc-453d-a495-225bb0c429ab: org.jboss.resteasy.spi.UnhandledException: java.lang.NoSuchMethodError: org.apache.http.impl.client.HttpClientBuilder.setConnectionTimeToLive(JLjava/util/concurrent/TimeUnit;)Lorg/apache/http/impl/client/HttpClientBuilder;<br>        at org.jboss.resteasy.core.ExceptionHandler.handleApplicationException(ExceptionHandler.java:76)<u></u><u></u></p></div></div></blockquote><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal">Are you using the standalone Keycloak server? Looking at javadocs for httpclient setConnectionTimeToLive was added in 4.4. WildFly 10 uses httpclient 4.5, so looks like for some reason you have an old version of httpclient.<u></u><u></u></p></div><div><p class="MsoNormal"> <u></u><u></u></p></div><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt"><p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif"><br>Best regards,<br><br></span><br>_______________________________________________<br>keycloak-user mailing list<br><a href="mailto:keycloak-user@lists.jboss.org" target="_blank">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><u></u><u></u></p></blockquote></div><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal"><br><br><br><u></u><u></u></p><pre>_______________________________________________<u></u><u></u></pre><pre>keycloak-user mailing list<u></u><u></u></pre><pre><a href="mailto:keycloak-user@lists.jboss.org" target="_blank">keycloak-user@lists.jboss.org</a><u></u><u></u></pre><pre><a href="https://lists.jboss.org/mailman/listinfo/keycloak-user" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a><u></u><u></u></pre></blockquote><p class="MsoNormal"><br><br><u></u><u></u></p><pre>-- <u></u><u></u></pre><pre>Bill Burke<u></u><u></u></pre><pre>JBoss, a division of Red Hat<u></u><u></u></pre><pre><a href="http://bill.burkecentral.com" target="_blank">http://bill.burkecentral.com</a><u></u><u></u></pre></div></div></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><p><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;"><br></span></p><p><font face="arial, helvetica, sans-serif"><span style="font-size:10pt">Best
regards,<br>
<br>
</span><a href="http://www.affordabletours.com/" title="blocked::http://www.affordabletours.com/" target="_blank"><b><span style="font-size:10pt;color:blue">AffordableTours.com</span></b></a><br>
<span style="font-size:10pt">Firdos Ali<br>
Senior Project Manager<br>
11150 Cash Road</span><br>
<span style="font-size:10pt">Stafford, TX 77477</span><br>
<span style="font-size:10pt">Toll Free (800) 935-2620 X181<br>
Direct (281) 269-2681<br>
Fax (281) 269-2691<br>
E-mail: <a href="mailto:ali@affordabletours.com" title="blocked::mailto:ali@affordabletours.com" target="_blank"><span style="color:blue">ali@affordabletours.com</span></a><br>
My Working Hours: Mon - Fri: 09:00AM - 05:00PM CST</span></font></p>

<p align="center" style="text-align:center"><i><span style="font-size:8pt;color:black"><font face="arial, helvetica, sans-serif">NOTICE: This e-mail message, including any attachments, is for the use of
the intended recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or distribution is
prohibited. If you are not the recipient, please contact the sender by reply e-mail
and destroy all copies of the original message</font></span></i></p></div></div>
</div>