<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <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:<br>
    </div>
    <blockquote cite="mid:1426669246.859226667@apps.rackspace.com"
      type="cite"><font face="arial" size="2">
        <p style="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;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;font-family: arial; font-size:
          10pt; word-wrap: break-word;"> </p>
        <p style="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;font-family: arial; font-size:
          10pt; word-wrap: break-word;">1/ Installed the adapter on
          tomcat</p>
        <p style="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;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;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;font-family: arial; font-size:
          10pt; word-wrap: break-word;"> </p>
        <p style="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>
              &lt;Valve
          className="org.keycloak.adapters.tomcat.KeycloakAuthenticatorValve"
          /&gt;<br>
          &lt;/Context&gt;</p>
        <p style="margin:0;padding:0;font-family: arial; font-size:
          10pt; word-wrap: break-word;"> </p>
        <p style="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;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;font-family: arial; font-size:
          10pt; word-wrap: break-word;"> </p>
        <p style="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;font-family: arial; font-size:
          10pt; word-wrap: break-word;">&lt;!DOCTYPE web-app PUBLIC<br>
           "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"<br>
           <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>
            &lt;display-name&gt;Archetype Created Web
          Application&lt;/display-name&gt;<br>
          <br>
              &lt;security-constraint&gt;<br>
                  &lt;web-resource-collection&gt;<br>
                     
          &lt;web-resource-name&gt;sample&lt;/web-resource-name&gt;<br>
                      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;<br>
                  &lt;/web-resource-collection&gt;<br>
                  &lt;auth-constraint&gt;<br>
                      &lt;role-name&gt;user&lt;/role-name&gt;<br>
                  &lt;/auth-constraint&gt;<br>
              &lt;/security-constraint&gt;<br>
              &lt;security-role&gt;<br>
                  &lt;role-name&gt;user&lt;/role-name&gt;<br>
              &lt;/security-role&gt;<br>
              &lt;login-config&gt;<br>
                  &lt;auth-method&gt;KEYCLOAK&lt;/auth-method&gt;<br>
                  &lt;realm-name&gt;demo&lt;/realm-name&gt;<br>
              &lt;/login-config&gt;<br>
          &lt;/web-app&gt;</p>
        <p style="margin:0;padding:0;font-family: arial; font-size:
          10pt; word-wrap: break-word;"> </p>
        <p style="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;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;font-family: arial; font-size:
          10pt; word-wrap: break-word;"> </p>
        <p style="margin:0;padding:0;font-family: arial; font-size:
          10pt; word-wrap: break-word;">Kalinga</p>
        <p style="margin:0;padding:0;font-family: arial; font-size:
          10pt; word-wrap: break-word;"> </p>
      </font>
      <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>
  </body>
</html>