<font face="arial" size="2"><p style="margin:0;padding:0;font-family: arial; font-size: 10pt; word-wrap: break-word;">It didnt. Thats why i did the change to the catalina.jar file.</p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt; word-wrap: break-word;">Managed to come up with this <a href="http://blog-ungarida.rhcloud.com/keycloak-tomcat-adapter/">http://blog-ungarida.rhcloud.com/keycloak-tomcat-adapter/</a></p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt; word-wrap: break-word;">Thats why I did this change to catalina.jar.</p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt; word-wrap: break-word;">&nbsp;</p>
<!--WM_COMPOSE_SIGNATURE_START-->
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt; word-wrap: break-word;">Kalinga<br /><br />-----Original Message-----<br />From: "Marek Posolda" &lt;mposolda@redhat.com&gt;<br />Sent: Wednesday, March 18, 2015 4:50pm<br />To: "Kalinga Dissanayake" &lt;kalinga@leapset.com&gt;, keycloak-user@lists.jboss.org, "Stian Thorgersen" &lt;stian@redhat.com&gt;<br />Subject: Re: [keycloak-user] Tomcat adapter for keycloak<br /><br /></p>
<div id="SafeStyles1426678769">
<div class="moz-cite-prefix">For Tomcat adapter, you don't need KEYCLOAK authentication type in web.xml, but BASIC should be sufficient. Does it work with BASIC and without your step 3 (Changing catalina.jar) ?<br /><br /> Marek<br /><br /> On 18.3.2015 10:00, Kalinga Dissanayake wrote:</div>
<blockquote>
<p style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; word-wrap: break-word;">I am in the process of trying out a few adapters supported by keycloak.</p>
<p style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; word-wrap: break-word;">Tried the tomcat adapter but im a getting a continuous redirect on the browser.</p>
<p style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; word-wrap: break-word;">&nbsp;</p>
<p style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; word-wrap: break-word;">I did the following;</p>
<p style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; word-wrap: break-word;">1/ Installed the adapter on tomcat</p>
<p style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; word-wrap: break-word;">2/ Installed all the libraries.</p>
<p style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; word-wrap: break-word;">3/ Changed catalina.jar to add an authentication type called KEYCLOAK</p>
<p style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; word-wrap: break-word;">4/ Added the context.xml to the client in META-INF</p>
<p style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; word-wrap: break-word;">&nbsp;</p>
<p style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; word-wrap: break-word;">&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br /> &lt;Context path="/sample" debug="0" privileged="true"&gt;<br /> &nbsp;&nbsp;&nbsp; &lt;Valve className="org.keycloak.adapters.tomcat.KeycloakAuthenticatorValve" /&gt;<br /> &lt;/Context&gt;</p>
<p style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; word-wrap: break-word;">&nbsp;</p>
<p style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; word-wrap: break-word;">5/ Added the keycloak.json</p>
<p style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; word-wrap: break-word;">{<br /> "realm": "demo",<br /> "realm-public-key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC6pigvwuJUVfi9sEaZOj7txNfBwPAEt+0AIBSFHRzoWSxNAnznkwGV83qGK+Kc6GAMdlch87GeFzSZh76qC9GUlQ1WGOjbNA4YApnd9PmLvt1iBfe/3xkjIBeKEYmeA9mg3xn3eTosWmL1WIFzFy4NRbe09fAC1hZ5zazfjSDBtwIDAQAB",<br /> "auth-server-url": <a class="moz-txt-link-rfc2396E" href="http://localhost:8080/auth">"http://localhost:8080/auth"</a>,<br /> "ssl-required": "external",<br /> "resource": "customer-portal",<br /> "public-client": true,<br /> "use-resource-role-mappings": true<br /> }</p>
<p style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; word-wrap: break-word;">&nbsp;</p>
<p style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; word-wrap: break-word;">6/ Changed web.xml</p>
<p style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; word-wrap: break-word;">&lt;!DOCTYPE web-app PUBLIC<br /> &nbsp;"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"<br /> &nbsp;<a class="moz-txt-link-rfc2396E" href="http://java.sun.com/dtd/web-app_2_3.dtd">"http://java.sun.com/dtd/web-app_2_3.dtd"</a> &gt;<br /><br /> &lt;web-app&gt;<br /> &nbsp; &lt;display-name&gt;Archetype Created Web Application&lt;/display-name&gt;<br /><br /> &nbsp;&nbsp;&nbsp; &lt;security-constraint&gt;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;web-resource-collection&gt;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;web-resource-name&gt;sample&lt;/web-resource-name&gt;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;url-pattern&gt;/*&lt;/url-pattern&gt;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/web-resource-collection&gt;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;auth-constraint&gt;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;role-name&gt;user&lt;/role-name&gt;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/auth-constraint&gt;<br /> &nbsp;&nbsp;&nbsp; &lt;/security-constraint&gt;<br /> &nbsp;&nbsp;&nbsp; &lt;security-role&gt;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;role-name&gt;user&lt;/role-name&gt;<br /> &nbsp;&nbsp;&nbsp; &lt;/security-role&gt;<br /> &nbsp;&nbsp;&nbsp; &lt;login-config&gt;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;auth-method&gt;KEYCLOAK&lt;/auth-method&gt;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;realm-name&gt;demo&lt;/realm-name&gt;<br /> &nbsp;&nbsp;&nbsp; &lt;/login-config&gt;<br /> &lt;/web-app&gt;</p>
<p style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; word-wrap: break-word;">&nbsp;</p>
<p style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; word-wrap: break-word;">The client app successfully redirects to the server url (keycloak) and I can login entering the creds. and it redirects back to the client, however the client goes into a loop.</p>
<p style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; word-wrap: break-word;">Should I do a change in the client to extract some details and save it in the session? Or will be the adapter handle this for me</p>
<p style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; word-wrap: break-word;">&nbsp;</p>
<p style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; word-wrap: break-word;">Kalinga</p>
<p style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; word-wrap: break-word;">&nbsp;</p>
<br /><fieldset class="mimeAttachmentHeader"></fieldset><br />
<p style="margin:0;padding:0;">_______________________________________________
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>
</div></font>