integration
+ tomcat6
tomcat7
tomcat8
jetty/jetty81
diff --git a/testsuite/tomcat6/pom.xml b/testsuite/tomcat6/pom.xml
new file mode 100755
index 0000000000..e18f5e677f
--- /dev/null
+++ b/testsuite/tomcat6/pom.xml
@@ -0,0 +1,501 @@
+
+
+
+ keycloak-testsuite-pom
+ org.keycloak
+ 1.1.0.Beta2-SNAPSHOT
+ ../pom.xml
+
+ 4.0.0
+
+ keycloak-testsuite-tomcat6
+ Keycloak Tomcat 6 Integration TestSuite
+
+ 6.0.41
+
+
+
+
+
+ org.keycloak
+ keycloak-dependencies-server-all
+ ${project.version}
+ pom
+
+
+ org.keycloak
+ keycloak-admin-client
+ ${project.version}
+
+
+ log4j
+ log4j
+
+
+ org.slf4j
+ slf4j-api
+
+
+ org.slf4j
+ slf4j-log4j12
+ ${slf4j.version}
+
+
+ org.jboss.spec.javax.servlet
+ jboss-servlet-api_3.0_spec
+
+
+ org.jboss.resteasy
+ jaxrs-api
+ ${resteasy.version.latest}
+
+
+ org.jboss.resteasy
+ resteasy-jaxrs
+ ${resteasy.version.latest}
+
+
+ log4j
+ log4j
+
+
+ org.slf4j
+ slf4j-api
+
+
+ org.slf4j
+ slf4j-simple
+
+
+
+
+ org.jboss.resteasy
+ resteasy-client
+ ${resteasy.version.latest}
+
+
+ org.jboss.resteasy
+ resteasy-crypto
+ ${resteasy.version.latest}
+
+
+ org.jboss.resteasy
+ resteasy-multipart-provider
+ ${resteasy.version.latest}
+
+
+ org.jboss.resteasy
+ resteasy-jackson-provider
+ ${resteasy.version.latest}
+
+
+ org.jboss.resteasy
+ resteasy-undertow
+ ${resteasy.version.latest}
+
+
+ com.google.zxing
+ javase
+
+
+ org.bouncycastle
+ bcprov-jdk16
+
+
+ org.apache.httpcomponents
+ httpclient
+ ${keycloak.apache.httpcomponents.version}
+
+
+ org.keycloak
+ keycloak-ldap-federation
+ ${project.version}
+
+
+ org.keycloak
+ keycloak-undertow-adapter
+ ${project.version}
+
+
+ org.keycloak
+ keycloak-tomcat6-adapter
+ ${project.version}
+
+
+ org.jboss.logging
+ jboss-logging
+
+
+ io.undertow
+ undertow-servlet
+
+
+ io.undertow
+ undertow-core
+
+
+ org.codehaus.jackson
+ jackson-core-asl
+
+
+ org.codehaus.jackson
+ jackson-mapper-asl
+
+
+ org.codehaus.jackson
+ jackson-xc
+
+
+ junit
+ junit
+
+
+ org.hamcrest
+ hamcrest-all
+
+
+ org.hibernate.javax.persistence
+ hibernate-jpa-2.0-api
+
+
+ com.h2database
+ h2
+
+
+ org.hibernate
+ hibernate-entitymanager
+
+
+ com.icegreen
+ greenmail
+
+
+ org.slf4j
+ slf4j-api
+
+
+
+
+ org.infinispan
+ infinispan-core
+
+
+ org.seleniumhq.selenium
+ selenium-java
+
+
+ xml-apis
+ xml-apis
+
+
+ org.seleniumhq.selenium
+ selenium-chrome-driver
+
+
+ org.wildfly
+ wildfly-undertow
+ ${wildfly.version}
+ test
+
+
+ org.keycloak
+ keycloak-testsuite-integration
+ ${project.version}
+ test
+
+
+ org.keycloak
+ keycloak-testsuite-integration
+ ${project.version}
+ test-jar
+ test
+
+
+ org.apache.tomcat
+ catalina
+ ${tomcat.version}
+
+
+ org.apache.tomcat
+ coyote
+ ${tomcat.version}
+
+
+ org.apache.tomcat
+ jasper
+ ${tomcat.version}
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+ 2.2
+
+
+
+ test-jar
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+
+ true
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+
+ ${maven.compiler.target}
+
+
+
+ org.codehaus.mojo
+ exec-maven-plugin
+
+ ${project.basedir}
+
+
+
+
+
+
+
+ keycloak-server
+
+
+
+ org.codehaus.mojo
+ exec-maven-plugin
+
+ org.keycloak.testutils.KeycloakServer
+
+
+
+
+
+
+ mail-server
+
+
+
+ org.codehaus.mojo
+ exec-maven-plugin
+
+ org.keycloak.testutils.MailServer
+
+
+
+
+
+
+ totp
+
+
+
+ org.codehaus.mojo
+ exec-maven-plugin
+
+ org.keycloak.testutils.TotpGenerator
+
+
+
+
+
+
+
+ jpa
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+
+
+ jpa
+ jpa
+ jpa
+ jpa
+
+
+
+
+
+
+
+
+ mongo
+
+
+ localhost
+ 27018
+ keycloak
+ true
+ 127.0.0.1
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+
+
+ test
+ integration-test
+
+ test
+
+
+
+ mongo
+ mongo
+ mongo
+ mongo
+ ${keycloak.connectionsMongo.host}
+ ${keycloak.connectionsMongo.port}
+ ${keycloak.connectionsMongo.db}
+ ${keycloak.connectionsMongo.clearOnStartup}
+ ${keycloak.connectionsMongo.bindIp}
+
+
+
+
+ default-test
+
+ true
+
+
+
+
+
+
+
+ com.github.joelittlejohn.embedmongo
+ embedmongo-maven-plugin
+
+
+ start-mongodb
+ pre-integration-test
+
+ start
+
+
+ ${keycloak.connectionsMongo.port}
+ file
+ ${project.build.directory}/mongodb.log
+ ${keycloak.connectionsMongo.bindIp}
+
+
+
+ stop-mongodb
+ post-integration-test
+
+ stop
+
+
+
+
+
+
+
+
+
+
+ infinispan
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+
+
+ infinispan
+ infinispan
+ infinispan
+
+
+
+
+
+
+
+
+
+
+
+ keycloak.connectionsJpa.driver
+ com.mysql.jdbc.Driver
+
+
+ mysql
+
+
+ mysql
+ mysql-connector-java
+ ${mysql.version}
+
+
+
+
+
+
+
+
+ keycloak.connectionsJpa.driver
+ org.postgresql.Driver
+
+
+ postgresql
+
+
+ org.postgresql
+ postgresql
+ ${postgresql.version}
+
+
+
+
+
+ clean-jpa
+
+
+
+ org.liquibase
+ liquibase-maven-plugin
+
+ META-INF/jpa-changelog-master.xml
+
+ ${keycloak.connectionsJpa.url}
+ ${keycloak.connectionsJpa.driver}
+ ${keycloak.connectionsJpa.user}
+ ${keycloak.connectionsJpa.password}
+
+ false
+
+
+
+ clean-jpa
+ clean
+
+ dropAll
+
+
+
+
+
+
+
+
+
diff --git a/testsuite/tomcat6/src/test/java/org/keycloak/testsuite/TomcatServer.java b/testsuite/tomcat6/src/test/java/org/keycloak/testsuite/TomcatServer.java
new file mode 100755
index 0000000000..ca7b77c085
--- /dev/null
+++ b/testsuite/tomcat6/src/test/java/org/keycloak/testsuite/TomcatServer.java
@@ -0,0 +1,131 @@
+package org.keycloak.testsuite;
+
+import org.apache.catalina.Engine;
+import org.apache.catalina.Host;
+import org.apache.catalina.LifecycleException;
+import org.apache.catalina.connector.Connector;
+import org.apache.catalina.core.StandardContext;
+import org.apache.catalina.startup.Embedded;
+import org.keycloak.adapters.tomcat.KeycloakAuthenticatorValve;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class TomcatServer {
+ private Embedded server;
+ private int port;
+ private boolean isRunning;
+
+ private static final Logger LOG = LoggerFactory.getLogger(TomcatServer.class);
+ private static final boolean isInfo = LOG.isInfoEnabled();
+
+
+ /**
+ * Create a new Tomcat embedded server instance. Setup looks like:
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * & will be created automcatically. We need to hook the remaining to an {@link Embedded} instnace
+ *
+ * @param contextPath Context path for the application
+ * @param port Port number to be used for the embedded Tomcat server
+ * @param appBase Path to the Application files (for Maven based web apps, in general: /src/main/
)
+ * @param shutdownHook If true, registers a server' shutdown hook with JVM. This is useful to shutdown the server
+ * in erroneous cases.
+ * @throws Exception
+ */
+ public TomcatServer(String contextPath, int port, String appBase, boolean shutdownHook) {
+ if (contextPath == null || appBase == null || appBase.length() == 0) {
+ throw new IllegalArgumentException("Context path or appbase should not be null");
+ }
+ if (!contextPath.startsWith("/")) {
+ contextPath = "/" + contextPath;
+ }
+
+ this.port = port;
+
+ server = new Embedded();
+ server.setName("TomcatEmbeddedServer");
+
+ Host localHost = server.createHost("localhost", appBase);
+ localHost.setAutoDeploy(false);
+
+ StandardContext rootContext = (StandardContext) server.createContext(contextPath, "webapp");
+ KeycloakAuthenticatorValve valve = new KeycloakAuthenticatorValve();
+ rootContext.addValve(valve);
+ //rootContext.addLifecycleListener(valve);
+ rootContext.setDefaultWebXml("web.xml");
+ localHost.addChild(rootContext);
+
+ Engine engine = server.createEngine();
+ engine.setDefaultHost(localHost.getName());
+ engine.setName("TomcatEngine");
+ engine.addChild(localHost);
+
+ server.addEngine(engine);
+
+ Connector connector = server.createConnector(localHost.getName(), port, false);
+ server.addConnector(connector);
+
+ // register shutdown hook
+ if (shutdownHook) {
+ Runtime.getRuntime().addShutdownHook(new Thread() {
+ public void run() {
+ if (isRunning) {
+ if (isInfo) LOG.info("Stopping the Tomcat server, through shutdown hook");
+ try {
+ if (server != null) {
+ server.stop();
+ }
+ } catch (LifecycleException e) {
+ LOG.error("Error while stopping the Tomcat server, through shutdown hook", e);
+ }
+ }
+ }
+ });
+ }
+
+ }
+
+ /**
+ * Start the tomcat embedded server
+ */
+ public void start() throws LifecycleException {
+ if (isRunning) {
+ LOG.warn("Tomcat server is already running @ port={}; ignoring the start", port);
+ return;
+ }
+
+ if (isInfo) LOG.info("Starting the Tomcat server @ port={}", port);
+
+ server.setAwait(true);
+ server.start();
+ isRunning = true;
+ }
+
+ /**
+ * Stop the tomcat embedded server
+ */
+ public void stop() throws LifecycleException {
+ if (!isRunning) {
+ LOG.warn("Tomcat server is not running @ port={}", port);
+ return;
+ }
+
+ if (isInfo) LOG.info("Stopping the Tomcat server");
+
+ server.stop();
+ isRunning = false;
+ }
+
+ public boolean isRunning() {
+ return isRunning;
+ }
+
+}
\ No newline at end of file
diff --git a/testsuite/tomcat6/src/test/java/org/keycloak/testsuite/TomcatTest.java b/testsuite/tomcat6/src/test/java/org/keycloak/testsuite/TomcatTest.java
new file mode 100755
index 0000000000..1b36bde717
--- /dev/null
+++ b/testsuite/tomcat6/src/test/java/org/keycloak/testsuite/TomcatTest.java
@@ -0,0 +1,187 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.keycloak.testsuite;
+
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Ignore;
+import org.junit.Rule;
+import org.junit.Test;
+import org.keycloak.KeycloakSecurityContext;
+import org.keycloak.OAuth2Constants;
+import org.keycloak.models.KeycloakSession;
+import org.keycloak.models.RealmModel;
+import org.keycloak.protocol.oidc.OpenIDConnectService;
+import org.keycloak.representations.idm.RealmRepresentation;
+import org.keycloak.services.managers.RealmManager;
+import org.keycloak.testsuite.pages.LoginPage;
+import org.keycloak.testsuite.rule.AbstractKeycloakRule;
+import org.keycloak.testsuite.rule.WebResource;
+import org.keycloak.testsuite.rule.WebRule;
+import org.keycloak.testutils.KeycloakServer;
+import org.openqa.selenium.WebDriver;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.ws.rs.core.UriBuilder;
+import java.io.File;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.net.URL;
+import java.security.Principal;
+import java.util.regex.Matcher;
+
+/**
+ * @author Stian Thorgersen
+ */
+public class TomcatTest {
+ static String logoutUri = OpenIDConnectService.logoutUrl(UriBuilder.fromUri("http://localhost:8081/auth"))
+ .queryParam(OAuth2Constants.REDIRECT_URI, "http://localhost:8080/customer-portal").build("demo").toString();
+
+ @ClassRule
+ public static AbstractKeycloakRule keycloakRule = new AbstractKeycloakRule() {
+ @Override
+ protected void configure(KeycloakSession session, RealmManager manager, RealmModel adminRealm) {
+ RealmRepresentation representation = KeycloakServer.loadJson(getClass().getResourceAsStream("/tomcat-test/demorealm.json"), RealmRepresentation.class);
+ RealmModel realm = manager.importRealm(representation);
+ }
+ };
+
+ public static class SendUsernameServlet extends HttpServlet {
+ @Override
+ protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException {
+ resp.setContentType("text/plain");
+ OutputStream stream = resp.getOutputStream();
+ Principal principal = req.getUserPrincipal();
+ if (principal == null) {
+ stream.write("null".getBytes());
+ return;
+ }
+ String name = principal.getName();
+ stream.write(name.getBytes());
+ stream.write("\n".getBytes());
+ KeycloakSecurityContext context = (KeycloakSecurityContext)req.getAttribute(KeycloakSecurityContext.class.getName());
+ stream.write(context.getIdToken().getName().getBytes());
+ stream.write("\n".getBytes());
+ stream.write(logoutUri.getBytes());
+
+ }
+ @Override
+ protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException {
+ doGet(req, resp);
+ }
+ }
+
+ static TomcatServer tomcat = null;
+
+ @BeforeClass
+ public static void initTomcat() throws Exception {
+ URL dir = TomcatTest.class.getResource("/tomcat-test/webapp/META-INF/context.xml");
+ String baseDir = new File(dir.getFile()).getParentFile().getParentFile().getParentFile().toString();
+ System.out.println("Tomcat basedir: " + baseDir);
+ tomcat = new TomcatServer("/customer-portal", 8080, baseDir, false);
+
+
+ tomcat.start();
+ //tomcat.getServer().await();
+ }
+
+ @AfterClass
+ public static void shutdownTomcat() throws Exception {
+ tomcat.stop();
+ }
+
+ @Rule
+ public WebRule webRule = new WebRule(this);
+ @WebResource
+ protected WebDriver driver;
+ @WebResource
+ protected LoginPage loginPage;
+
+ public static final String LOGIN_URL = OpenIDConnectService.loginPageUrl(UriBuilder.fromUri("http://localhost:8081/auth")).build("demo").toString();
+
+ @Ignore
+ @Test
+ public void testServer() throws Exception{
+ Thread.sleep(1000000000);
+ }
+
+ @Test
+ public void testLoginSSOAndLogout() throws Exception {
+ driver.navigate().to("http://localhost:8080/customer-portal");
+ System.out.println("Current url: " + driver.getCurrentUrl());
+ //System.out.println(driver.getPageSource());
+ Assert.assertTrue(driver.getCurrentUrl().startsWith(LOGIN_URL));
+ loginPage.login("bburke@redhat.com", "password");
+ System.out.println("Current url: " + driver.getCurrentUrl());
+ Assert.assertEquals(driver.getCurrentUrl(), "http://localhost:8080/customer-portal");
+ String pageSource = driver.getPageSource();
+ System.out.println(pageSource);
+ Assert.assertTrue(pageSource.contains("Bill Burke"));
+
+ // test logout
+
+ String logoutUri = OpenIDConnectService.logoutUrl(UriBuilder.fromUri("http://localhost:8081/auth"))
+ .queryParam(OAuth2Constants.REDIRECT_URI, "http://localhost:8080/customer-portal").build("demo").toString();
+ driver.navigate().to(logoutUri);
+ Assert.assertTrue(driver.getCurrentUrl().startsWith(LOGIN_URL));
+ driver.navigate().to("http://localhost:8080/customer-portal");
+ String currentUrl = driver.getCurrentUrl();
+ Assert.assertTrue(currentUrl.startsWith(LOGIN_URL));
+
+
+ }
+
+ @Test
+ @Ignore
+ public void runit() throws Exception {
+ Thread.sleep(10000000);
+ }
+
+
+ private static String getBaseDirectory() {
+ String dirPath = null;
+ String relativeDirPath = "testsuite" + File.separator + "tomcat6" + File.separator + "target";
+
+ if (System.getProperties().containsKey("maven.home")) {
+ dirPath = System.getProperty("user.dir").replaceFirst("testsuite.tomcat6.*", Matcher.quoteReplacement(relativeDirPath));
+ } else {
+ for (String c : System.getProperty("java.class.path").split(File.pathSeparator)) {
+ if (c.contains(File.separator + "testsuite" + File.separator + "tomcat6")) {
+ dirPath = c.replaceFirst("testsuite.tomcat6.*", Matcher.quoteReplacement(relativeDirPath));
+ break;
+ }
+ }
+ }
+
+ String absolutePath = new File(dirPath).getAbsolutePath();
+ return absolutePath;
+ }
+
+
+
+
+}
diff --git a/testsuite/tomcat6/src/test/resources/tomcat-test/demorealm.json b/testsuite/tomcat6/src/test/resources/tomcat-test/demorealm.json
new file mode 100755
index 0000000000..a4a6ec9903
--- /dev/null
+++ b/testsuite/tomcat6/src/test/resources/tomcat-test/demorealm.json
@@ -0,0 +1,58 @@
+{
+ "id": "demo",
+ "realm": "demo",
+ "enabled": true,
+ "accessTokenLifespan": 3000,
+ "accessCodeLifespan": 10,
+ "accessCodeLifespanUserAction": 6000,
+ "sslRequired": "external",
+ "registrationAllowed": false,
+ "social": false,
+ "passwordCredentialGrantAllowed": true,
+ "updateProfileOnInitialSocialLogin": false,
+ "privateKey": "MIICXAIBAAKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQABAoGAfmO8gVhyBxdqlxmIuglbz8bcjQbhXJLR2EoS8ngTXmN1bo2L90M0mUKSdc7qF10LgETBzqL8jYlQIbt+e6TH8fcEpKCjUlyq0Mf/vVbfZSNaVycY13nTzo27iPyWQHK5NLuJzn1xvxxrUeXI6A2WFpGEBLbHjwpx5WQG9A+2scECQQDvdn9NE75HPTVPxBqsEd2z10TKkl9CZxu10Qby3iQQmWLEJ9LNmy3acvKrE3gMiYNWb6xHPKiIqOR1as7L24aTAkEAtyvQOlCvr5kAjVqrEKXalj0Tzewjweuxc0pskvArTI2Oo070h65GpoIKLc9jf+UA69cRtquwP93aZKtW06U8dQJAF2Y44ks/mK5+eyDqik3koCI08qaC8HYq2wVl7G2QkJ6sbAaILtcvD92ToOvyGyeE0flvmDZxMYlvaZnaQ0lcSQJBAKZU6umJi3/xeEbkJqMfeLclD27XGEFoPeNrmdx0q10Azp4NfJAY+Z8KRyQCR2BEG+oNitBOZ+YXF9KCpH3cdmECQHEigJhYg+ykOvr1aiZUMFT72HU0jnmQe2FVekuG+LJUt2Tm7GtMjTFoGpf0JwrVuZN39fOYAlo+nTixgeW7X8Y=",
+ "publicKey": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQAB",
+ "requiredCredentials": [ "password" ],
+ "users" : [
+ {
+ "username" : "bburke@redhat.com",
+ "enabled": true,
+ "email" : "bburke@redhat.com",
+ "firstName": "Bill",
+ "lastName": "Burke",
+ "credentials" : [
+ { "type" : "password",
+ "value" : "password" }
+ ],
+ "realmRoles": [ "user", "admin" ],
+ "applicationRoles": {
+ "account": [ "manage-account" ]
+ }
+ }
+ ],
+ "roles" : {
+ "realm" : [
+ {
+ "name": "user",
+ "description": "User privileges"
+ },
+ {
+ "name": "admin",
+ "description": "Administrator privileges"
+ }
+ ]
+ },
+ "applications": [
+ {
+ "name": "customer-portal",
+ "enabled": true,
+ "fullScopeAllowed": true,
+ "adminUrl": "http://localhost:8080/customer-portal",
+ "baseUrl": "http://localhost:8080/customer-portal",
+ "redirectUris": [
+ "http://localhost:8080/customer-portal/*"
+ ],
+ "secret": "password"
+ }
+ ]
+}
diff --git a/testsuite/tomcat6/src/test/resources/tomcat-test/webapp/META-INF/context.xml b/testsuite/tomcat6/src/test/resources/tomcat-test/webapp/META-INF/context.xml
new file mode 100755
index 0000000000..6f24639879
--- /dev/null
+++ b/testsuite/tomcat6/src/test/resources/tomcat-test/webapp/META-INF/context.xml
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/testsuite/tomcat6/src/test/resources/tomcat-test/webapp/WEB-INF/keycloak.json b/testsuite/tomcat6/src/test/resources/tomcat-test/webapp/WEB-INF/keycloak.json
new file mode 100755
index 0000000000..4e2fe1e556
--- /dev/null
+++ b/testsuite/tomcat6/src/test/resources/tomcat-test/webapp/WEB-INF/keycloak.json
@@ -0,0 +1,10 @@
+{
+ "realm": "demo",
+ "resource": "customer-portal",
+ "realm-public-key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQAB",
+ "auth-server-url": "http://localhost:8081/auth",
+ "ssl-required" : "external",
+ "credentials": {
+ "secret": "password"
+ }
+}
diff --git a/testsuite/tomcat6/src/test/resources/tomcat-test/webapp/WEB-INF/web.xml b/testsuite/tomcat6/src/test/resources/tomcat-test/webapp/WEB-INF/web.xml
new file mode 100755
index 0000000000..12416c8b73
--- /dev/null
+++ b/testsuite/tomcat6/src/test/resources/tomcat-test/webapp/WEB-INF/web.xml
@@ -0,0 +1,40 @@
+
+
+
+ adapter-test
+
+
+ SendUsername
+ org.keycloak.testsuite.TomcatTest$SendUsernameServlet
+
+
+
+ SendUsername
+ /*
+
+
+
+
+ Admins
+ /*
+
+
+ admin
+
+
+
+
+ BASIC
+ demo
+
+
+
+ admin
+
+
+ user
+
+