diff --git a/integration/adapter-core/src/main/java/org/keycloak/adapters/AdapterDeploymentContext.java b/integration/adapter-core/src/main/java/org/keycloak/adapters/AdapterDeploymentContext.java
index 541012fddc..1a83571a86 100755
--- a/integration/adapter-core/src/main/java/org/keycloak/adapters/AdapterDeploymentContext.java
+++ b/integration/adapter-core/src/main/java/org/keycloak/adapters/AdapterDeploymentContext.java
@@ -285,6 +285,7 @@ public class AdapterDeploymentContext {
scheme = "https";
}
if (!request.getScheme().equals(scheme) && request.getPort() != -1) {
+ log.error("request scheme: " + request.getScheme() + " ssl required: " + deployment.isSslRequired());
throw new RuntimeException("Can't resolve relative url from adapter config.");
}
builder.scheme(scheme);
diff --git a/integration/as7-eap6/adapter/src/main/java/org/keycloak/adapters/as7/KeycloakAuthenticatorValve.java b/integration/as7-eap6/adapter/src/main/java/org/keycloak/adapters/as7/KeycloakAuthenticatorValve.java
index 6c0c58fc6b..d9b6911d83 100755
--- a/integration/as7-eap6/adapter/src/main/java/org/keycloak/adapters/as7/KeycloakAuthenticatorValve.java
+++ b/integration/as7-eap6/adapter/src/main/java/org/keycloak/adapters/as7/KeycloakAuthenticatorValve.java
@@ -106,6 +106,7 @@ public class KeycloakAuthenticatorValve extends FormAuthenticator implements Lif
@Override
public void invoke(Request request, Response response) throws IOException, ServletException {
try {
+ log.info("invoke");
CatalinaHttpFacade facade = new CatalinaHttpFacade(request, response);
PreAuthActionsHandler handler = new PreAuthActionsHandler(userSessionManagement, deploymentContext, facade);
if (handler.handleRequest()) {
@@ -119,9 +120,11 @@ public class KeycloakAuthenticatorValve extends FormAuthenticator implements Lif
@Override
public boolean authenticate(Request request, HttpServletResponse response, LoginConfig config) throws IOException {
+ log.info("*** authenticate");
CatalinaHttpFacade facade = new CatalinaHttpFacade(request, response);
KeycloakDeployment deployment = deploymentContext.resolveDeployment(facade);
if (deployment == null || !deployment.isConfigured()) {
+ log.info("*** deployment isn't configured return false");
return false;
}
diff --git a/project-integrations/README.md b/project-integrations/README.md
new file mode 100644
index 0000000000..f9299b2af6
--- /dev/null
+++ b/project-integrations/README.md
@@ -0,0 +1,5 @@
+Keycloak External Project Integrations
+==========
+
+Everthing in this directory is examples related to integration with non-keycloak projects. Its a sandbox we use to test integrations with third-party projects
+
\ No newline at end of file
diff --git a/project-integrations/aerogear-ups/README.md b/project-integrations/aerogear-ups/README.md
new file mode 100755
index 0000000000..83732aa173
--- /dev/null
+++ b/project-integrations/aerogear-ups/README.md
@@ -0,0 +1,18 @@
+Self Bootstrapping Keycloak Server and Application
+==========================================================
+
+This is an example of bundling a keycloak server war and application together so that keycloak is bootstrapped out of the
+box.
+
+* There is a testrealm.json file that is used to bootstrap the realm in the auth-server/ project
+* Notice that there is a context-param in auth-server/web.xml called keycloak.import.realm.resources. This sets up the import of the json file
+* If you open up testrealm.json, notice that all urls are relative. Keycloak will now extrapolate the host and port based
+on the request if the configured urls are just a path and don't have a schem, host, and port.
+* In app, there is a BootstrapListener class. This obtains the config context of the adapter and initializes it.
+* Notice that this class sets up a relative URL. Also notice that the application is a "public" client. This is so that
+we don't have to query the database for the application's secret. Also notice that the realm key is not set. Keycloak adapter
+will now query the auth server url for the public key of the realm.
+
+Problems:
+* Biggest problem is SSL. You have to crack open web.xml to set up a confidential security constraint. You also have
+to change the adapter config and the realm config to make SSL required.
diff --git a/project-integrations/aerogear-ups/app/pom.xml b/project-integrations/aerogear-ups/app/pom.xml
new file mode 100755
index 0000000000..31239638ae
--- /dev/null
+++ b/project-integrations/aerogear-ups/app/pom.xml
@@ -0,0 +1,113 @@
+
+
+
+ keycloak-parent
+ org.keycloak
+ 1.0-beta-1-SNAPSHOT
+ ../../../pom.xml
+
+
+ 4.0.0
+ ups-example-app
+ war
+ Keycloak Secured App EAP 6.x
+
+
+
+
+ org.bouncycastle
+ bcprov-jdk16
+
+
+ org.keycloak
+ keycloak-core
+ ${project.version}
+
+
+ org.keycloak
+ keycloak-adapter-core
+ ${project.version}
+
+
+ org.keycloak
+ keycloak-jboss-adapter-core
+ ${project.version}
+
+
+ org.keycloak
+ keycloak-as7-adapter
+ ${project.version}
+
+
+ net.iharder
+ base64
+
+
+ org.jboss.spec.javax.servlet
+ jboss-servlet-api_3.0_spec
+ provided
+
+
+
+ org.jboss.resteasy
+ resteasy-jaxrs
+ ${resteasy.version}
+ provided
+
+
+ org.jboss.resteasy
+ async-http-servlet-3.0
+ ${resteasy.version}
+ provided
+
+
+ org.jboss.resteasy
+ jaxrs-api
+ ${resteasy.version}
+ provided
+
+
+ org.jboss.resteasy
+ resteasy-jackson-provider
+ ${resteasy.version}
+ provided
+
+
+
+
+ javax.enterprise
+ cdi-api
+ 1.1
+ provided
+
+
+
+
+
+ app
+
+
+ org.jboss.as.plugins
+ jboss-as-maven-plugin
+ 7.5.Final
+
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+
+ true
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+
+ ${maven.compiler.target}
+
+
+
+
+
diff --git a/project-integrations/aerogear-ups/app/src/main/java/org/keycloak/example/BootstrapListener.java b/project-integrations/aerogear-ups/app/src/main/java/org/keycloak/example/BootstrapListener.java
new file mode 100755
index 0000000000..f7284b931e
--- /dev/null
+++ b/project-integrations/aerogear-ups/app/src/main/java/org/keycloak/example/BootstrapListener.java
@@ -0,0 +1,31 @@
+package org.keycloak.example;
+
+import org.keycloak.adapters.AdapterDeploymentContext;
+import org.keycloak.representations.adapters.config.AdapterConfig;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+/**
+ * @author Bill Burke
+ * @version $Revision: 1 $
+ */
+public class BootstrapListener implements ServletContextListener {
+ @Override
+ public void contextInitialized(ServletContextEvent sce) {
+ AdapterDeploymentContext deploymentContext = (AdapterDeploymentContext)sce.getServletContext().getAttribute(AdapterDeploymentContext.class.getName());
+ AdapterConfig config = new AdapterConfig();
+ config.setRealm("demo");
+ config.setResource("customer-portal");
+ config.setAuthServerUrl("/auth");
+ config.setSslNotRequired(true);
+ config.setPublicClient(true);
+ deploymentContext.updateDeployment(config);
+
+ }
+
+ @Override
+ public void contextDestroyed(ServletContextEvent sce) {
+
+ }
+}
diff --git a/project-integrations/aerogear-ups/app/src/main/resources/META-INF/beans.xml b/project-integrations/aerogear-ups/app/src/main/resources/META-INF/beans.xml
new file mode 100644
index 0000000000..57025b5976
--- /dev/null
+++ b/project-integrations/aerogear-ups/app/src/main/resources/META-INF/beans.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/project-integrations/aerogear-ups/app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/project-integrations/aerogear-ups/app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml
new file mode 100755
index 0000000000..8c92fe914f
--- /dev/null
+++ b/project-integrations/aerogear-ups/app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/project-integrations/aerogear-ups/app/src/main/webapp/WEB-INF/jboss-web.xml b/project-integrations/aerogear-ups/app/src/main/webapp/WEB-INF/jboss-web.xml
new file mode 100755
index 0000000000..2f94ba4bca
--- /dev/null
+++ b/project-integrations/aerogear-ups/app/src/main/webapp/WEB-INF/jboss-web.xml
@@ -0,0 +1,5 @@
+
+
+ org.keycloak.adapters.as7.KeycloakAuthenticatorValve
+
+
\ No newline at end of file
diff --git a/project-integrations/aerogear-ups/app/src/main/webapp/WEB-INF/web.xml b/project-integrations/aerogear-ups/app/src/main/webapp/WEB-INF/web.xml
new file mode 100755
index 0000000000..af91ffa36e
--- /dev/null
+++ b/project-integrations/aerogear-ups/app/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,54 @@
+
+
+
+ app
+
+
+ org.keycloak.example.BootstrapListener
+
+
+
+
+
+ Customers
+ /customers/*
+
+
+ user
+
+
+
+
+
+ Database
+ /rest/*
+
+
+ user
+
+
+
+
+
+ BASIC
+ demo
+
+
+
+ admin
+
+
+ user
+
+
+
+
+
+
diff --git a/project-integrations/aerogear-ups/app/src/main/webapp/customers/view.jsp b/project-integrations/aerogear-ups/app/src/main/webapp/customers/view.jsp
new file mode 100755
index 0000000000..be4d93c27e
--- /dev/null
+++ b/project-integrations/aerogear-ups/app/src/main/webapp/customers/view.jsp
@@ -0,0 +1,47 @@
+<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
+ pageEncoding="ISO-8859-1" %>
+<%@ page import="org.keycloak.example.services.CustomerDatabaseClient" %>
+<%@ page import="org.keycloak.util.KeycloakUriBuilder" %>
+<%@ page import="org.keycloak.representations.IDToken" %>
+
+