From cf3aa24ba592e00211fbc8a3a1e9209b9796c99d Mon Sep 17 00:00:00 2001 From: Bill Burke Date: Thu, 16 Jan 2014 22:16:50 -0500 Subject: [PATCH] demo-template --- distribution/examples-docs-zip/assembly.xml | 2 +- distribution/examples-docs-zip/build.xml | 37 ++++++ distribution/examples-docs-zip/pom.xml | 39 +++++++ .../example/CustomerDatabaseClient.java | 49 -------- .../as7-eap-demo/database-service/pom.xml | 79 ------------- .../src/main/webapp/WEB-INF/keycloak.json | 7 -- examples/as7-eap-demo/pom.xml | 43 ------- examples/as7-eap-demo/product-app/pom.xml | 64 ----------- .../src/main/webapp/WEB-INF/keycloak.json | 10 -- .../WEB-INF/jboss-deployment-structure.xml | 7 -- .../src/main/webapp/WEB-INF/keycloak.json | 11 -- .../WEB-INF/jboss-deployment-structure.xml | 7 -- .../src/main/webapp/WEB-INF/keycloak.json | 11 -- .../README.md => demo-template/README.md.as7} | 0 .../README.md.wildfly} | 0 .../customer-app/pom.xml | 16 ++- .../example/CustomerDatabaseClient.java | 0 .../jboss-deployment-structure.xml.as7} | 0 .../jboss-deployment-structure.xml.wildfly} | 0 .../src/main/webapp/WEB-INF/jboss-web.xml | 0 .../src/main/webapp/WEB-INF/keycloak.json | 0 .../src/main/webapp/WEB-INF/web.xml | 2 +- .../src/main/webapp/WEB-INF/web.xml.wildfly} | 0 .../src/main/webapp/admin/admin.jsp | 0 .../src/main/webapp/customers/cors-test.html | 0 .../src/main/webapp/customers/view.jsp | 0 .../customer-app/src/main/webapp/index.html | 0 .../database-service/pom.xml | 30 +++-- .../example/oauth/CustomerService.java | 0 .../example/oauth/DataApplication.java | 0 .../example/oauth/ProductService.java | 0 .../jboss-deployment-structure.xml.as7} | 0 .../jboss-deployment-structure.xml.wildfly} | 0 .../src/main/webapp/WEB-INF/jboss-web.xml | 0 .../src/main/webapp/WEB-INF/keycloak.json | 0 .../src/main/webapp/WEB-INF/web.xml | 2 +- .../src/main/webapp/WEB-INF/web.xml.wildfly} | 0 .../{wildfly-demo => demo-template}/pom.xml | 2 +- .../product-app/pom.xml | 21 +++- .../example/oauth/ProductDatabaseClient.java | 0 .../jboss-deployment-structure.xml.as7} | 1 - .../jboss-deployment-structure.xml.wildfly} | 0 .../src/main/webapp/WEB-INF/jboss-web.xml | 0 .../src/main/webapp/WEB-INF/keycloak.json | 0 .../src/main/webapp/WEB-INF/web.xml | 2 +- .../src/main/webapp/WEB-INF/web.xml.wildfly} | 0 .../src/main/webapp/admin/admin.jsp | 0 .../product-app/src/main/webapp/index.html | 0 .../src/main/webapp/products/view.jsp | 0 .../testrealm.json | 0 .../third-party-cdi/pom.xml | 2 +- .../example/oauth/AppContextListener.java | 0 .../example/oauth/CDIResourcesProducer.java | 0 .../example/oauth/DatabaseClient.java | 0 .../example/oauth/MessagesChecker.java | 0 .../example/oauth/RefreshTokenFilter.java | 0 .../oauth/ServletRequestQualifier.java | 0 .../org/keycloak/example/oauth/UserData.java | 0 .../src/main/webapp/WEB-INF/beans.xml | 0 .../src/main/webapp/WEB-INF/faces-config.xml | 0 .../src/main/webapp/WEB-INF/keycloak.json | 0 .../src/main/webapp/WEB-INF/web.xml | 0 .../src/main/webapp/client.xhtml | 0 .../src/main/webapp/index.html | 0 .../third-party/pom.xml | 2 +- .../org/keycloak/example/oauth/Bootstrap.java | 0 .../example/oauth/ProductDatabaseClient.java | 0 .../src/main/webapp/WEB-INF/keycloak.json | 0 .../src/main/webapp/WEB-INF/web.xml | 0 .../third-party/src/main/webapp/index.html | 0 .../third-party/src/main/webapp/pull_data.jsp | 0 .../third-party/src/main/webapp/redirect.jsp | 0 examples/pom.xml | 3 +- examples/wildfly-demo/customer-app/pom.xml | 64 ----------- .../src/main/webapp/WEB-INF/keycloak.json | 11 -- .../src/main/webapp/admin/admin.jsp | 11 -- .../src/main/webapp/customers/cors-test.html | 38 ------- .../src/main/webapp/customers/view.jsp | 30 ----- .../customer-app/src/main/webapp/index.html | 14 --- .../example/oauth/CustomerService.java | 26 ----- .../example/oauth/DataApplication.java | 13 --- .../example/oauth/ProductService.java | 26 ----- .../example/oauth/ProductDatabaseClient.java | 50 --------- .../src/main/webapp/admin/admin.jsp | 11 -- .../product-app/src/main/webapp/index.html | 14 --- .../src/main/webapp/products/view.jsp | 31 ----- examples/wildfly-demo/testrealm.json | 106 ------------------ examples/wildfly-demo/third-party-cdi/pom.xml | 74 ------------ .../example/oauth/AppContextListener.java | 57 ---------- .../example/oauth/CDIResourcesProducer.java | 41 ------- .../example/oauth/DatabaseClient.java | 104 ----------------- .../example/oauth/MessagesChecker.java | 34 ------ .../example/oauth/RefreshTokenFilter.java | 62 ---------- .../oauth/ServletRequestQualifier.java | 19 ---- .../org/keycloak/example/oauth/UserData.java | 63 ----------- .../src/main/webapp/WEB-INF/beans.xml | 23 ---- .../src/main/webapp/WEB-INF/faces-config.xml | 23 ---- .../WEB-INF/jboss-deployment-structure.xml | 7 -- .../src/main/webapp/WEB-INF/web.xml | 20 ---- .../src/main/webapp/client.xhtml | 37 ------ .../src/main/webapp/index.html | 5 - examples/wildfly-demo/third-party/pom.xml | 56 --------- .../org/keycloak/example/oauth/Bootstrap.java | 69 ------------ .../example/oauth/ProductDatabaseClient.java | 72 ------------ .../WEB-INF/jboss-deployment-structure.xml | 7 -- .../src/main/webapp/WEB-INF/web.xml | 23 ---- .../third-party/src/main/webapp/index.html | 6 - .../third-party/src/main/webapp/pull_data.jsp | 22 ---- .../third-party/src/main/webapp/redirect.jsp | 3 - 109 files changed, 136 insertions(+), 1585 deletions(-) create mode 100755 distribution/examples-docs-zip/build.xml delete mode 100755 examples/as7-eap-demo/customer-app/src/main/java/org/keycloak/example/CustomerDatabaseClient.java delete mode 100755 examples/as7-eap-demo/database-service/pom.xml delete mode 100755 examples/as7-eap-demo/database-service/src/main/webapp/WEB-INF/keycloak.json delete mode 100755 examples/as7-eap-demo/pom.xml delete mode 100755 examples/as7-eap-demo/product-app/pom.xml delete mode 100755 examples/as7-eap-demo/product-app/src/main/webapp/WEB-INF/keycloak.json delete mode 100755 examples/as7-eap-demo/third-party-cdi/src/main/webapp/WEB-INF/jboss-deployment-structure.xml delete mode 100755 examples/as7-eap-demo/third-party-cdi/src/main/webapp/WEB-INF/keycloak.json delete mode 100755 examples/as7-eap-demo/third-party/src/main/webapp/WEB-INF/jboss-deployment-structure.xml delete mode 100755 examples/as7-eap-demo/third-party/src/main/webapp/WEB-INF/keycloak.json rename examples/{as7-eap-demo/README.md => demo-template/README.md.as7} (100%) rename examples/{wildfly-demo/README.md => demo-template/README.md.wildfly} (100%) rename examples/{as7-eap-demo => demo-template}/customer-app/pom.xml (76%) rename examples/{wildfly-demo => demo-template}/customer-app/src/main/java/org/keycloak/example/CustomerDatabaseClient.java (100%) rename examples/{as7-eap-demo/customer-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml => demo-template/customer-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml.as7} (100%) rename examples/{wildfly-demo/customer-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml => demo-template/customer-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml.wildfly} (100%) rename examples/{as7-eap-demo => demo-template}/customer-app/src/main/webapp/WEB-INF/jboss-web.xml (100%) rename examples/{as7-eap-demo => demo-template}/customer-app/src/main/webapp/WEB-INF/keycloak.json (100%) rename examples/{as7-eap-demo => demo-template}/customer-app/src/main/webapp/WEB-INF/web.xml (97%) rename examples/{wildfly-demo/customer-app/src/main/webapp/WEB-INF/web.xml => demo-template/customer-app/src/main/webapp/WEB-INF/web.xml.wildfly} (100%) rename examples/{as7-eap-demo => demo-template}/customer-app/src/main/webapp/admin/admin.jsp (100%) rename examples/{as7-eap-demo => demo-template}/customer-app/src/main/webapp/customers/cors-test.html (100%) rename examples/{as7-eap-demo => demo-template}/customer-app/src/main/webapp/customers/view.jsp (100%) rename examples/{as7-eap-demo => demo-template}/customer-app/src/main/webapp/index.html (100%) mode change 100644 => 100755 rename examples/{wildfly-demo => demo-template}/database-service/pom.xml (73%) rename examples/{as7-eap-demo => demo-template}/database-service/src/main/java/org/keycloak/example/oauth/CustomerService.java (100%) mode change 100644 => 100755 rename examples/{as7-eap-demo => demo-template}/database-service/src/main/java/org/keycloak/example/oauth/DataApplication.java (100%) mode change 100644 => 100755 rename examples/{as7-eap-demo => demo-template}/database-service/src/main/java/org/keycloak/example/oauth/ProductService.java (100%) mode change 100644 => 100755 rename examples/{as7-eap-demo/database-service/src/main/webapp/WEB-INF/jboss-deployment-structure.xml => demo-template/database-service/src/main/webapp/WEB-INF/jboss-deployment-structure.xml.as7} (100%) rename examples/{wildfly-demo/database-service/src/main/webapp/WEB-INF/jboss-deployment-structure.xml => demo-template/database-service/src/main/webapp/WEB-INF/jboss-deployment-structure.xml.wildfly} (100%) rename examples/{as7-eap-demo => demo-template}/database-service/src/main/webapp/WEB-INF/jboss-web.xml (100%) rename examples/{wildfly-demo => demo-template}/database-service/src/main/webapp/WEB-INF/keycloak.json (100%) rename examples/{as7-eap-demo => demo-template}/database-service/src/main/webapp/WEB-INF/web.xml (95%) rename examples/{wildfly-demo/database-service/src/main/webapp/WEB-INF/web.xml => demo-template/database-service/src/main/webapp/WEB-INF/web.xml.wildfly} (100%) rename examples/{wildfly-demo => demo-template}/pom.xml (94%) rename examples/{wildfly-demo => demo-template}/product-app/pom.xml (71%) rename examples/{as7-eap-demo => demo-template}/product-app/src/main/java/org/keycloak/example/oauth/ProductDatabaseClient.java (100%) rename examples/{as7-eap-demo/product-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml => demo-template/product-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml.as7} (82%) rename examples/{wildfly-demo/product-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml => demo-template/product-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml.wildfly} (100%) rename examples/{as7-eap-demo => demo-template}/product-app/src/main/webapp/WEB-INF/jboss-web.xml (100%) rename examples/{wildfly-demo => demo-template}/product-app/src/main/webapp/WEB-INF/keycloak.json (100%) rename examples/{as7-eap-demo => demo-template}/product-app/src/main/webapp/WEB-INF/web.xml (97%) rename examples/{wildfly-demo/product-app/src/main/webapp/WEB-INF/web.xml => demo-template/product-app/src/main/webapp/WEB-INF/web.xml.wildfly} (100%) rename examples/{as7-eap-demo => demo-template}/product-app/src/main/webapp/admin/admin.jsp (100%) mode change 100644 => 100755 rename examples/{as7-eap-demo => demo-template}/product-app/src/main/webapp/index.html (100%) mode change 100644 => 100755 rename examples/{as7-eap-demo => demo-template}/product-app/src/main/webapp/products/view.jsp (100%) rename examples/{as7-eap-demo => demo-template}/testrealm.json (100%) rename examples/{as7-eap-demo => demo-template}/third-party-cdi/pom.xml (95%) rename examples/{as7-eap-demo => demo-template}/third-party-cdi/src/main/java/org/keycloak/example/oauth/AppContextListener.java (100%) mode change 100644 => 100755 rename examples/{as7-eap-demo => demo-template}/third-party-cdi/src/main/java/org/keycloak/example/oauth/CDIResourcesProducer.java (100%) mode change 100644 => 100755 rename examples/{as7-eap-demo => demo-template}/third-party-cdi/src/main/java/org/keycloak/example/oauth/DatabaseClient.java (100%) rename examples/{as7-eap-demo => demo-template}/third-party-cdi/src/main/java/org/keycloak/example/oauth/MessagesChecker.java (100%) mode change 100644 => 100755 rename examples/{as7-eap-demo => demo-template}/third-party-cdi/src/main/java/org/keycloak/example/oauth/RefreshTokenFilter.java (100%) mode change 100644 => 100755 rename examples/{as7-eap-demo => demo-template}/third-party-cdi/src/main/java/org/keycloak/example/oauth/ServletRequestQualifier.java (100%) mode change 100644 => 100755 rename examples/{as7-eap-demo => demo-template}/third-party-cdi/src/main/java/org/keycloak/example/oauth/UserData.java (100%) mode change 100644 => 100755 rename examples/{as7-eap-demo => demo-template}/third-party-cdi/src/main/webapp/WEB-INF/beans.xml (100%) mode change 100644 => 100755 rename examples/{as7-eap-demo => demo-template}/third-party-cdi/src/main/webapp/WEB-INF/faces-config.xml (100%) mode change 100644 => 100755 rename examples/{wildfly-demo => demo-template}/third-party-cdi/src/main/webapp/WEB-INF/keycloak.json (100%) rename examples/{as7-eap-demo => demo-template}/third-party-cdi/src/main/webapp/WEB-INF/web.xml (100%) rename examples/{as7-eap-demo => demo-template}/third-party-cdi/src/main/webapp/client.xhtml (100%) mode change 100644 => 100755 rename examples/{as7-eap-demo => demo-template}/third-party-cdi/src/main/webapp/index.html (100%) mode change 100644 => 100755 rename examples/{as7-eap-demo => demo-template}/third-party/pom.xml (94%) rename examples/{as7-eap-demo => demo-template}/third-party/src/main/java/org/keycloak/example/oauth/Bootstrap.java (100%) rename examples/{as7-eap-demo => demo-template}/third-party/src/main/java/org/keycloak/example/oauth/ProductDatabaseClient.java (100%) rename examples/{wildfly-demo => demo-template}/third-party/src/main/webapp/WEB-INF/keycloak.json (100%) rename examples/{as7-eap-demo => demo-template}/third-party/src/main/webapp/WEB-INF/web.xml (100%) rename examples/{as7-eap-demo => demo-template}/third-party/src/main/webapp/index.html (100%) mode change 100644 => 100755 rename examples/{as7-eap-demo => demo-template}/third-party/src/main/webapp/pull_data.jsp (100%) rename examples/{as7-eap-demo => demo-template}/third-party/src/main/webapp/redirect.jsp (100%) delete mode 100755 examples/wildfly-demo/customer-app/pom.xml delete mode 100755 examples/wildfly-demo/customer-app/src/main/webapp/WEB-INF/keycloak.json delete mode 100755 examples/wildfly-demo/customer-app/src/main/webapp/admin/admin.jsp delete mode 100755 examples/wildfly-demo/customer-app/src/main/webapp/customers/cors-test.html delete mode 100755 examples/wildfly-demo/customer-app/src/main/webapp/customers/view.jsp delete mode 100644 examples/wildfly-demo/customer-app/src/main/webapp/index.html delete mode 100644 examples/wildfly-demo/database-service/src/main/java/org/keycloak/example/oauth/CustomerService.java delete mode 100644 examples/wildfly-demo/database-service/src/main/java/org/keycloak/example/oauth/DataApplication.java delete mode 100644 examples/wildfly-demo/database-service/src/main/java/org/keycloak/example/oauth/ProductService.java delete mode 100755 examples/wildfly-demo/product-app/src/main/java/org/keycloak/example/oauth/ProductDatabaseClient.java delete mode 100644 examples/wildfly-demo/product-app/src/main/webapp/admin/admin.jsp delete mode 100644 examples/wildfly-demo/product-app/src/main/webapp/index.html delete mode 100755 examples/wildfly-demo/product-app/src/main/webapp/products/view.jsp delete mode 100755 examples/wildfly-demo/testrealm.json delete mode 100755 examples/wildfly-demo/third-party-cdi/pom.xml delete mode 100644 examples/wildfly-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/AppContextListener.java delete mode 100644 examples/wildfly-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/CDIResourcesProducer.java delete mode 100755 examples/wildfly-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/DatabaseClient.java delete mode 100644 examples/wildfly-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/MessagesChecker.java delete mode 100644 examples/wildfly-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/RefreshTokenFilter.java delete mode 100644 examples/wildfly-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/ServletRequestQualifier.java delete mode 100644 examples/wildfly-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/UserData.java delete mode 100644 examples/wildfly-demo/third-party-cdi/src/main/webapp/WEB-INF/beans.xml delete mode 100644 examples/wildfly-demo/third-party-cdi/src/main/webapp/WEB-INF/faces-config.xml delete mode 100755 examples/wildfly-demo/third-party-cdi/src/main/webapp/WEB-INF/jboss-deployment-structure.xml delete mode 100755 examples/wildfly-demo/third-party-cdi/src/main/webapp/WEB-INF/web.xml delete mode 100644 examples/wildfly-demo/third-party-cdi/src/main/webapp/client.xhtml delete mode 100644 examples/wildfly-demo/third-party-cdi/src/main/webapp/index.html delete mode 100755 examples/wildfly-demo/third-party/pom.xml delete mode 100755 examples/wildfly-demo/third-party/src/main/java/org/keycloak/example/oauth/Bootstrap.java delete mode 100755 examples/wildfly-demo/third-party/src/main/java/org/keycloak/example/oauth/ProductDatabaseClient.java delete mode 100755 examples/wildfly-demo/third-party/src/main/webapp/WEB-INF/jboss-deployment-structure.xml delete mode 100755 examples/wildfly-demo/third-party/src/main/webapp/WEB-INF/web.xml delete mode 100644 examples/wildfly-demo/third-party/src/main/webapp/index.html delete mode 100755 examples/wildfly-demo/third-party/src/main/webapp/pull_data.jsp delete mode 100755 examples/wildfly-demo/third-party/src/main/webapp/redirect.jsp diff --git a/distribution/examples-docs-zip/assembly.xml b/distribution/examples-docs-zip/assembly.xml index 77b75306d7..b5ab178ba6 100755 --- a/distribution/examples-docs-zip/assembly.xml +++ b/distribution/examples-docs-zip/assembly.xml @@ -15,7 +15,7 @@ - ../../examples + target/examples examples **/.svn/** diff --git a/distribution/examples-docs-zip/build.xml b/distribution/examples-docs-zip/build.xml new file mode 100755 index 0000000000..abc30c9aca --- /dev/null +++ b/distribution/examples-docs-zip/build.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/distribution/examples-docs-zip/pom.xml b/distribution/examples-docs-zip/pom.xml index 2621391187..cc76a4ed06 100755 --- a/distribution/examples-docs-zip/pom.xml +++ b/distribution/examples-docs-zip/pom.xml @@ -16,6 +16,44 @@ + + org.apache.maven.plugins + maven-antrun-plugin + 1.7 + false + + + build-example + + run + + compile + + + + + + + + + + + + ant-contrib + ant-contrib + 1.0b3 + + + ant + ant + + + + + + + + diff --git a/examples/as7-eap-demo/customer-app/src/main/java/org/keycloak/example/CustomerDatabaseClient.java b/examples/as7-eap-demo/customer-app/src/main/java/org/keycloak/example/CustomerDatabaseClient.java deleted file mode 100755 index 2d6249849d..0000000000 --- a/examples/as7-eap-demo/customer-app/src/main/java/org/keycloak/example/CustomerDatabaseClient.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.keycloak.example; - -import org.apache.http.HttpEntity; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpGet; -import org.keycloak.SkeletonKeySession; -import org.keycloak.adapters.HttpClientBuilder; -import org.keycloak.util.JsonSerialization; - -import javax.servlet.http.HttpServletRequest; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; - -/** - * @author Bill Burke - * @version $Revision: 1 $ - */ -public class CustomerDatabaseClient { - - static class TypedList extends ArrayList {} - - public static List getCustomers(HttpServletRequest req) { - SkeletonKeySession session = (SkeletonKeySession)req.getAttribute(SkeletonKeySession.class.getName()); - HttpClient client = new HttpClientBuilder() - .trustStore(session.getMetadata().getTruststore()) - .hostnameVerification(HttpClientBuilder.HostnameVerificationPolicy.ANY).build(); - try { - HttpGet get = new HttpGet("http://localhost:8080/database/customers"); - get.addHeader("Authorization", "Bearer " + session.getTokenString()); - try { - HttpResponse response = client.execute(get); - HttpEntity entity = response.getEntity(); - InputStream is = entity.getContent(); - try { - return JsonSerialization.readValue(is, TypedList.class); - } finally { - is.close(); - } - } catch (IOException e) { - throw new RuntimeException(e); - } - } finally { - client.getConnectionManager().shutdown(); - } - } -} diff --git a/examples/as7-eap-demo/database-service/pom.xml b/examples/as7-eap-demo/database-service/pom.xml deleted file mode 100755 index ef834765b7..0000000000 --- a/examples/as7-eap-demo/database-service/pom.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - - keycloak-parent - org.keycloak - 1.0-alpha-1-SNAPSHOT - ../../../pom.xml - - 4.0.0 - org.keycloak.example.as7.demo - database-service - war - JAX-RS Database Service Using OAuth Bearer Tokens - - http://maven.apache.org - - - - jboss - jboss repo - http://repository.jboss.org/nexus/content/groups/public/ - - - - - - org.jboss.resteasy - resteasy-client - provided - - - org.jboss.resteasy - resteasy-jaxrs - provided - - - - org.keycloak - keycloak-as7-adapter - ${project.version} - provided - - - - - - database - - - org.apache.maven.plugins - maven-deploy-plugin - - true - - - - org.jboss.as.plugins - jboss-as-maven-plugin - 7.4.Final - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.6 - 1.6 - - - - - diff --git a/examples/as7-eap-demo/database-service/src/main/webapp/WEB-INF/keycloak.json b/examples/as7-eap-demo/database-service/src/main/webapp/WEB-INF/keycloak.json deleted file mode 100755 index efcb8e0c1c..0000000000 --- a/examples/as7-eap-demo/database-service/src/main/webapp/WEB-INF/keycloak.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "realm" : "demo", - "resource" : "database-service", - "realm-public-key" : "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQAB", - "enable-cors" : true - -} diff --git a/examples/as7-eap-demo/pom.xml b/examples/as7-eap-demo/pom.xml deleted file mode 100755 index fae3ad4253..0000000000 --- a/examples/as7-eap-demo/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - keycloak-parent - org.keycloak - 1.0-alpha-1-SNAPSHOT - ../../pom.xml - - Examples - - 4.0.0 - - org.keycloak - as7-eap-demo-pom - pom - - - - - org.apache.maven.plugins - maven-deploy-plugin - - true - - - - org.jboss.as.plugins - jboss-as-maven-plugin - 7.1.1.Final - - true - - - - - - customer-app - product-app - database-service - third-party - third-party-cdi - - diff --git a/examples/as7-eap-demo/product-app/pom.xml b/examples/as7-eap-demo/product-app/pom.xml deleted file mode 100755 index 8d08c52596..0000000000 --- a/examples/as7-eap-demo/product-app/pom.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - keycloak-parent - org.keycloak - 1.0-alpha-1-SNAPSHOT - ../../../pom.xml - - 4.0.0 - org.keycloak.example.as7.demo - product-portal-example - war - Product Portal - Secured via Valve - - - - - jboss - jboss repo - http://repository.jboss.org/nexus/content/groups/public/ - - - - - - org.jboss.spec.javax.servlet - jboss-servlet-api_3.0_spec - provided - - - org.keycloak - keycloak-as7-adapter - ${project.version} - provided - - - - - product-portal - - - org.jboss.as.plugins - jboss-as-maven-plugin - 7.4.Final - - - org.apache.maven.plugins - maven-deploy-plugin - - true - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.6 - 1.6 - - - - - diff --git a/examples/as7-eap-demo/product-app/src/main/webapp/WEB-INF/keycloak.json b/examples/as7-eap-demo/product-app/src/main/webapp/WEB-INF/keycloak.json deleted file mode 100755 index 1077ac2118..0000000000 --- a/examples/as7-eap-demo/product-app/src/main/webapp/WEB-INF/keycloak.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "realm" : "demo", - "resource" : "product-portal", - "realm-public-key" : "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQAB", - "auth-server-url" : "http://localhost:8080/auth", - "ssl-not-required" : true, - "credentials" : { - "password" : "password" - } -} diff --git a/examples/as7-eap-demo/third-party-cdi/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/examples/as7-eap-demo/third-party-cdi/src/main/webapp/WEB-INF/jboss-deployment-structure.xml deleted file mode 100755 index c54e4abec6..0000000000 --- a/examples/as7-eap-demo/third-party-cdi/src/main/webapp/WEB-INF/jboss-deployment-structure.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/examples/as7-eap-demo/third-party-cdi/src/main/webapp/WEB-INF/keycloak.json b/examples/as7-eap-demo/third-party-cdi/src/main/webapp/WEB-INF/keycloak.json deleted file mode 100755 index 3128adf7cc..0000000000 --- a/examples/as7-eap-demo/third-party-cdi/src/main/webapp/WEB-INF/keycloak.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "resource" : "third-party", - "auth-server-url" : "http://localhost:8080/auth", - "ssl-not-required" : true, - "credentials" : { - "password" : "password" - }, - "scope": { - "realm": [ "user" ] - } -} \ No newline at end of file diff --git a/examples/as7-eap-demo/third-party/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/examples/as7-eap-demo/third-party/src/main/webapp/WEB-INF/jboss-deployment-structure.xml deleted file mode 100755 index c54e4abec6..0000000000 --- a/examples/as7-eap-demo/third-party/src/main/webapp/WEB-INF/jboss-deployment-structure.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/examples/as7-eap-demo/third-party/src/main/webapp/WEB-INF/keycloak.json b/examples/as7-eap-demo/third-party/src/main/webapp/WEB-INF/keycloak.json deleted file mode 100755 index 3128adf7cc..0000000000 --- a/examples/as7-eap-demo/third-party/src/main/webapp/WEB-INF/keycloak.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "resource" : "third-party", - "auth-server-url" : "http://localhost:8080/auth", - "ssl-not-required" : true, - "credentials" : { - "password" : "password" - }, - "scope": { - "realm": [ "user" ] - } -} \ No newline at end of file diff --git a/examples/as7-eap-demo/README.md b/examples/demo-template/README.md.as7 similarity index 100% rename from examples/as7-eap-demo/README.md rename to examples/demo-template/README.md.as7 diff --git a/examples/wildfly-demo/README.md b/examples/demo-template/README.md.wildfly similarity index 100% rename from examples/wildfly-demo/README.md rename to examples/demo-template/README.md.wildfly diff --git a/examples/as7-eap-demo/customer-app/pom.xml b/examples/demo-template/customer-app/pom.xml similarity index 76% rename from examples/as7-eap-demo/customer-app/pom.xml rename to examples/demo-template/customer-app/pom.xml index 2008eb84df..02a83420c5 100755 --- a/examples/as7-eap-demo/customer-app/pom.xml +++ b/examples/demo-template/customer-app/pom.xml @@ -8,7 +8,7 @@ ../../../pom.xml 4.0.0 - org.keycloak.example.as7.demo + org.keycloak.example.demo customer-portal-example war Customer Portal - Secured via Valve @@ -30,10 +30,22 @@ org.keycloak - keycloak-as7-adapter + keycloak-core ${project.version} provided + + org.keycloak + keycloak-adapter-core + ${project.version} + provided + + + org.apache.httpcomponents + httpclient + ${keycloak.apache.httpcomponents.version} + provided + diff --git a/examples/wildfly-demo/customer-app/src/main/java/org/keycloak/example/CustomerDatabaseClient.java b/examples/demo-template/customer-app/src/main/java/org/keycloak/example/CustomerDatabaseClient.java similarity index 100% rename from examples/wildfly-demo/customer-app/src/main/java/org/keycloak/example/CustomerDatabaseClient.java rename to examples/demo-template/customer-app/src/main/java/org/keycloak/example/CustomerDatabaseClient.java diff --git a/examples/as7-eap-demo/customer-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/examples/demo-template/customer-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml.as7 similarity index 100% rename from examples/as7-eap-demo/customer-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml rename to examples/demo-template/customer-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml.as7 diff --git a/examples/wildfly-demo/customer-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/examples/demo-template/customer-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml.wildfly similarity index 100% rename from examples/wildfly-demo/customer-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml rename to examples/demo-template/customer-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml.wildfly diff --git a/examples/as7-eap-demo/customer-app/src/main/webapp/WEB-INF/jboss-web.xml b/examples/demo-template/customer-app/src/main/webapp/WEB-INF/jboss-web.xml similarity index 100% rename from examples/as7-eap-demo/customer-app/src/main/webapp/WEB-INF/jboss-web.xml rename to examples/demo-template/customer-app/src/main/webapp/WEB-INF/jboss-web.xml diff --git a/examples/as7-eap-demo/customer-app/src/main/webapp/WEB-INF/keycloak.json b/examples/demo-template/customer-app/src/main/webapp/WEB-INF/keycloak.json similarity index 100% rename from examples/as7-eap-demo/customer-app/src/main/webapp/WEB-INF/keycloak.json rename to examples/demo-template/customer-app/src/main/webapp/WEB-INF/keycloak.json diff --git a/examples/as7-eap-demo/customer-app/src/main/webapp/WEB-INF/web.xml b/examples/demo-template/customer-app/src/main/webapp/WEB-INF/web.xml similarity index 97% rename from examples/as7-eap-demo/customer-app/src/main/webapp/WEB-INF/web.xml rename to examples/demo-template/customer-app/src/main/webapp/WEB-INF/web.xml index 3933152c4d..608f9a24a8 100755 --- a/examples/as7-eap-demo/customer-app/src/main/webapp/WEB-INF/web.xml +++ b/examples/demo-template/customer-app/src/main/webapp/WEB-INF/web.xml @@ -37,7 +37,7 @@ BASIC - commerce + demo diff --git a/examples/wildfly-demo/customer-app/src/main/webapp/WEB-INF/web.xml b/examples/demo-template/customer-app/src/main/webapp/WEB-INF/web.xml.wildfly similarity index 100% rename from examples/wildfly-demo/customer-app/src/main/webapp/WEB-INF/web.xml rename to examples/demo-template/customer-app/src/main/webapp/WEB-INF/web.xml.wildfly diff --git a/examples/as7-eap-demo/customer-app/src/main/webapp/admin/admin.jsp b/examples/demo-template/customer-app/src/main/webapp/admin/admin.jsp similarity index 100% rename from examples/as7-eap-demo/customer-app/src/main/webapp/admin/admin.jsp rename to examples/demo-template/customer-app/src/main/webapp/admin/admin.jsp diff --git a/examples/as7-eap-demo/customer-app/src/main/webapp/customers/cors-test.html b/examples/demo-template/customer-app/src/main/webapp/customers/cors-test.html similarity index 100% rename from examples/as7-eap-demo/customer-app/src/main/webapp/customers/cors-test.html rename to examples/demo-template/customer-app/src/main/webapp/customers/cors-test.html diff --git a/examples/as7-eap-demo/customer-app/src/main/webapp/customers/view.jsp b/examples/demo-template/customer-app/src/main/webapp/customers/view.jsp similarity index 100% rename from examples/as7-eap-demo/customer-app/src/main/webapp/customers/view.jsp rename to examples/demo-template/customer-app/src/main/webapp/customers/view.jsp diff --git a/examples/as7-eap-demo/customer-app/src/main/webapp/index.html b/examples/demo-template/customer-app/src/main/webapp/index.html old mode 100644 new mode 100755 similarity index 100% rename from examples/as7-eap-demo/customer-app/src/main/webapp/index.html rename to examples/demo-template/customer-app/src/main/webapp/index.html diff --git a/examples/wildfly-demo/database-service/pom.xml b/examples/demo-template/database-service/pom.xml similarity index 73% rename from examples/wildfly-demo/database-service/pom.xml rename to examples/demo-template/database-service/pom.xml index 339670da4a..38dccfe1cd 100755 --- a/examples/wildfly-demo/database-service/pom.xml +++ b/examples/demo-template/database-service/pom.xml @@ -8,7 +8,7 @@ ../../../pom.xml 4.0.0 - org.keycloak.example.wildfly.demo + org.keycloak.example.demo database-service war JAX-RS Database Service Using OAuth Bearer Tokens @@ -34,20 +34,28 @@ resteasy-jaxrs provided - + + org.jboss.spec.javax.servlet + jboss-servlet-api_3.0_spec + provided + org.keycloak - keycloak-undertow-adapter + keycloak-core ${project.version} provided - + + + org.keycloak + keycloak-adapter-core + ${project.version} + provided + + + org.apache.httpcomponents + httpclient + ${keycloak.apache.httpcomponents.version} + provided diff --git a/examples/as7-eap-demo/database-service/src/main/java/org/keycloak/example/oauth/CustomerService.java b/examples/demo-template/database-service/src/main/java/org/keycloak/example/oauth/CustomerService.java old mode 100644 new mode 100755 similarity index 100% rename from examples/as7-eap-demo/database-service/src/main/java/org/keycloak/example/oauth/CustomerService.java rename to examples/demo-template/database-service/src/main/java/org/keycloak/example/oauth/CustomerService.java diff --git a/examples/as7-eap-demo/database-service/src/main/java/org/keycloak/example/oauth/DataApplication.java b/examples/demo-template/database-service/src/main/java/org/keycloak/example/oauth/DataApplication.java old mode 100644 new mode 100755 similarity index 100% rename from examples/as7-eap-demo/database-service/src/main/java/org/keycloak/example/oauth/DataApplication.java rename to examples/demo-template/database-service/src/main/java/org/keycloak/example/oauth/DataApplication.java diff --git a/examples/as7-eap-demo/database-service/src/main/java/org/keycloak/example/oauth/ProductService.java b/examples/demo-template/database-service/src/main/java/org/keycloak/example/oauth/ProductService.java old mode 100644 new mode 100755 similarity index 100% rename from examples/as7-eap-demo/database-service/src/main/java/org/keycloak/example/oauth/ProductService.java rename to examples/demo-template/database-service/src/main/java/org/keycloak/example/oauth/ProductService.java diff --git a/examples/as7-eap-demo/database-service/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/examples/demo-template/database-service/src/main/webapp/WEB-INF/jboss-deployment-structure.xml.as7 similarity index 100% rename from examples/as7-eap-demo/database-service/src/main/webapp/WEB-INF/jboss-deployment-structure.xml rename to examples/demo-template/database-service/src/main/webapp/WEB-INF/jboss-deployment-structure.xml.as7 diff --git a/examples/wildfly-demo/database-service/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/examples/demo-template/database-service/src/main/webapp/WEB-INF/jboss-deployment-structure.xml.wildfly similarity index 100% rename from examples/wildfly-demo/database-service/src/main/webapp/WEB-INF/jboss-deployment-structure.xml rename to examples/demo-template/database-service/src/main/webapp/WEB-INF/jboss-deployment-structure.xml.wildfly diff --git a/examples/as7-eap-demo/database-service/src/main/webapp/WEB-INF/jboss-web.xml b/examples/demo-template/database-service/src/main/webapp/WEB-INF/jboss-web.xml similarity index 100% rename from examples/as7-eap-demo/database-service/src/main/webapp/WEB-INF/jboss-web.xml rename to examples/demo-template/database-service/src/main/webapp/WEB-INF/jboss-web.xml diff --git a/examples/wildfly-demo/database-service/src/main/webapp/WEB-INF/keycloak.json b/examples/demo-template/database-service/src/main/webapp/WEB-INF/keycloak.json similarity index 100% rename from examples/wildfly-demo/database-service/src/main/webapp/WEB-INF/keycloak.json rename to examples/demo-template/database-service/src/main/webapp/WEB-INF/keycloak.json diff --git a/examples/as7-eap-demo/database-service/src/main/webapp/WEB-INF/web.xml b/examples/demo-template/database-service/src/main/webapp/WEB-INF/web.xml similarity index 95% rename from examples/as7-eap-demo/database-service/src/main/webapp/WEB-INF/web.xml rename to examples/demo-template/database-service/src/main/webapp/WEB-INF/web.xml index c77f70ab51..830ac59346 100755 --- a/examples/as7-eap-demo/database-service/src/main/webapp/WEB-INF/web.xml +++ b/examples/demo-template/database-service/src/main/webapp/WEB-INF/web.xml @@ -20,7 +20,7 @@ BASIC - commerce + demo diff --git a/examples/wildfly-demo/database-service/src/main/webapp/WEB-INF/web.xml b/examples/demo-template/database-service/src/main/webapp/WEB-INF/web.xml.wildfly similarity index 100% rename from examples/wildfly-demo/database-service/src/main/webapp/WEB-INF/web.xml rename to examples/demo-template/database-service/src/main/webapp/WEB-INF/web.xml.wildfly diff --git a/examples/wildfly-demo/pom.xml b/examples/demo-template/pom.xml similarity index 94% rename from examples/wildfly-demo/pom.xml rename to examples/demo-template/pom.xml index 95444ebfaa..2d0a32e355 100755 --- a/examples/wildfly-demo/pom.xml +++ b/examples/demo-template/pom.xml @@ -11,7 +11,7 @@ 4.0.0 org.keycloak - wildfly-demo-pom + demo-pom pom diff --git a/examples/wildfly-demo/product-app/pom.xml b/examples/demo-template/product-app/pom.xml similarity index 71% rename from examples/wildfly-demo/product-app/pom.xml rename to examples/demo-template/product-app/pom.xml index d7a8a010f0..43791f78a7 100755 --- a/examples/wildfly-demo/product-app/pom.xml +++ b/examples/demo-template/product-app/pom.xml @@ -8,7 +8,7 @@ ../../../pom.xml 4.0.0 - org.keycloak.example.wildfly.demo + org.keycloak.example.demo product-portal-example war Product Portal @@ -23,6 +23,11 @@ + + org.jboss.spec.javax.servlet + jboss-servlet-api_3.0_spec + provided + org.jboss.spec.javax.servlet jboss-servlet-api_3.0_spec @@ -30,10 +35,22 @@ org.keycloak - keycloak-undertow-adapter + keycloak-core ${project.version} provided + + org.keycloak + keycloak-adapter-core + ${project.version} + provided + + + org.apache.httpcomponents + httpclient + ${keycloak.apache.httpcomponents.version} + provided + diff --git a/examples/as7-eap-demo/product-app/src/main/java/org/keycloak/example/oauth/ProductDatabaseClient.java b/examples/demo-template/product-app/src/main/java/org/keycloak/example/oauth/ProductDatabaseClient.java similarity index 100% rename from examples/as7-eap-demo/product-app/src/main/java/org/keycloak/example/oauth/ProductDatabaseClient.java rename to examples/demo-template/product-app/src/main/java/org/keycloak/example/oauth/ProductDatabaseClient.java diff --git a/examples/as7-eap-demo/product-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/examples/demo-template/product-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml.as7 similarity index 82% rename from examples/as7-eap-demo/product-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml rename to examples/demo-template/product-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml.as7 index f8f12d36c0..e972711a03 100755 --- a/examples/as7-eap-demo/product-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml +++ b/examples/demo-template/product-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml.as7 @@ -1,6 +1,5 @@ - diff --git a/examples/wildfly-demo/product-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/examples/demo-template/product-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml.wildfly similarity index 100% rename from examples/wildfly-demo/product-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml rename to examples/demo-template/product-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml.wildfly diff --git a/examples/as7-eap-demo/product-app/src/main/webapp/WEB-INF/jboss-web.xml b/examples/demo-template/product-app/src/main/webapp/WEB-INF/jboss-web.xml similarity index 100% rename from examples/as7-eap-demo/product-app/src/main/webapp/WEB-INF/jboss-web.xml rename to examples/demo-template/product-app/src/main/webapp/WEB-INF/jboss-web.xml diff --git a/examples/wildfly-demo/product-app/src/main/webapp/WEB-INF/keycloak.json b/examples/demo-template/product-app/src/main/webapp/WEB-INF/keycloak.json similarity index 100% rename from examples/wildfly-demo/product-app/src/main/webapp/WEB-INF/keycloak.json rename to examples/demo-template/product-app/src/main/webapp/WEB-INF/keycloak.json diff --git a/examples/as7-eap-demo/product-app/src/main/webapp/WEB-INF/web.xml b/examples/demo-template/product-app/src/main/webapp/WEB-INF/web.xml similarity index 97% rename from examples/as7-eap-demo/product-app/src/main/webapp/WEB-INF/web.xml rename to examples/demo-template/product-app/src/main/webapp/WEB-INF/web.xml index dd17981230..f590136fa3 100755 --- a/examples/as7-eap-demo/product-app/src/main/webapp/WEB-INF/web.xml +++ b/examples/demo-template/product-app/src/main/webapp/WEB-INF/web.xml @@ -37,7 +37,7 @@ BASIC - commerce + demo diff --git a/examples/wildfly-demo/product-app/src/main/webapp/WEB-INF/web.xml b/examples/demo-template/product-app/src/main/webapp/WEB-INF/web.xml.wildfly similarity index 100% rename from examples/wildfly-demo/product-app/src/main/webapp/WEB-INF/web.xml rename to examples/demo-template/product-app/src/main/webapp/WEB-INF/web.xml.wildfly diff --git a/examples/as7-eap-demo/product-app/src/main/webapp/admin/admin.jsp b/examples/demo-template/product-app/src/main/webapp/admin/admin.jsp old mode 100644 new mode 100755 similarity index 100% rename from examples/as7-eap-demo/product-app/src/main/webapp/admin/admin.jsp rename to examples/demo-template/product-app/src/main/webapp/admin/admin.jsp diff --git a/examples/as7-eap-demo/product-app/src/main/webapp/index.html b/examples/demo-template/product-app/src/main/webapp/index.html old mode 100644 new mode 100755 similarity index 100% rename from examples/as7-eap-demo/product-app/src/main/webapp/index.html rename to examples/demo-template/product-app/src/main/webapp/index.html diff --git a/examples/as7-eap-demo/product-app/src/main/webapp/products/view.jsp b/examples/demo-template/product-app/src/main/webapp/products/view.jsp similarity index 100% rename from examples/as7-eap-demo/product-app/src/main/webapp/products/view.jsp rename to examples/demo-template/product-app/src/main/webapp/products/view.jsp diff --git a/examples/as7-eap-demo/testrealm.json b/examples/demo-template/testrealm.json similarity index 100% rename from examples/as7-eap-demo/testrealm.json rename to examples/demo-template/testrealm.json diff --git a/examples/as7-eap-demo/third-party-cdi/pom.xml b/examples/demo-template/third-party-cdi/pom.xml similarity index 95% rename from examples/as7-eap-demo/third-party-cdi/pom.xml rename to examples/demo-template/third-party-cdi/pom.xml index 8df4f5f427..1fe1804072 100755 --- a/examples/as7-eap-demo/third-party-cdi/pom.xml +++ b/examples/demo-template/third-party-cdi/pom.xml @@ -8,7 +8,7 @@ ../../../pom.xml 4.0.0 - org.keycloak.example.as7.demo + org.keycloak.example.demo oauth-client-cdi-example war Simple OAuth Client Using CDI and JSF diff --git a/examples/as7-eap-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/AppContextListener.java b/examples/demo-template/third-party-cdi/src/main/java/org/keycloak/example/oauth/AppContextListener.java old mode 100644 new mode 100755 similarity index 100% rename from examples/as7-eap-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/AppContextListener.java rename to examples/demo-template/third-party-cdi/src/main/java/org/keycloak/example/oauth/AppContextListener.java diff --git a/examples/as7-eap-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/CDIResourcesProducer.java b/examples/demo-template/third-party-cdi/src/main/java/org/keycloak/example/oauth/CDIResourcesProducer.java old mode 100644 new mode 100755 similarity index 100% rename from examples/as7-eap-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/CDIResourcesProducer.java rename to examples/demo-template/third-party-cdi/src/main/java/org/keycloak/example/oauth/CDIResourcesProducer.java diff --git a/examples/as7-eap-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/DatabaseClient.java b/examples/demo-template/third-party-cdi/src/main/java/org/keycloak/example/oauth/DatabaseClient.java similarity index 100% rename from examples/as7-eap-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/DatabaseClient.java rename to examples/demo-template/third-party-cdi/src/main/java/org/keycloak/example/oauth/DatabaseClient.java diff --git a/examples/as7-eap-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/MessagesChecker.java b/examples/demo-template/third-party-cdi/src/main/java/org/keycloak/example/oauth/MessagesChecker.java old mode 100644 new mode 100755 similarity index 100% rename from examples/as7-eap-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/MessagesChecker.java rename to examples/demo-template/third-party-cdi/src/main/java/org/keycloak/example/oauth/MessagesChecker.java diff --git a/examples/as7-eap-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/RefreshTokenFilter.java b/examples/demo-template/third-party-cdi/src/main/java/org/keycloak/example/oauth/RefreshTokenFilter.java old mode 100644 new mode 100755 similarity index 100% rename from examples/as7-eap-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/RefreshTokenFilter.java rename to examples/demo-template/third-party-cdi/src/main/java/org/keycloak/example/oauth/RefreshTokenFilter.java diff --git a/examples/as7-eap-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/ServletRequestQualifier.java b/examples/demo-template/third-party-cdi/src/main/java/org/keycloak/example/oauth/ServletRequestQualifier.java old mode 100644 new mode 100755 similarity index 100% rename from examples/as7-eap-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/ServletRequestQualifier.java rename to examples/demo-template/third-party-cdi/src/main/java/org/keycloak/example/oauth/ServletRequestQualifier.java diff --git a/examples/as7-eap-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/UserData.java b/examples/demo-template/third-party-cdi/src/main/java/org/keycloak/example/oauth/UserData.java old mode 100644 new mode 100755 similarity index 100% rename from examples/as7-eap-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/UserData.java rename to examples/demo-template/third-party-cdi/src/main/java/org/keycloak/example/oauth/UserData.java diff --git a/examples/as7-eap-demo/third-party-cdi/src/main/webapp/WEB-INF/beans.xml b/examples/demo-template/third-party-cdi/src/main/webapp/WEB-INF/beans.xml old mode 100644 new mode 100755 similarity index 100% rename from examples/as7-eap-demo/third-party-cdi/src/main/webapp/WEB-INF/beans.xml rename to examples/demo-template/third-party-cdi/src/main/webapp/WEB-INF/beans.xml diff --git a/examples/as7-eap-demo/third-party-cdi/src/main/webapp/WEB-INF/faces-config.xml b/examples/demo-template/third-party-cdi/src/main/webapp/WEB-INF/faces-config.xml old mode 100644 new mode 100755 similarity index 100% rename from examples/as7-eap-demo/third-party-cdi/src/main/webapp/WEB-INF/faces-config.xml rename to examples/demo-template/third-party-cdi/src/main/webapp/WEB-INF/faces-config.xml diff --git a/examples/wildfly-demo/third-party-cdi/src/main/webapp/WEB-INF/keycloak.json b/examples/demo-template/third-party-cdi/src/main/webapp/WEB-INF/keycloak.json similarity index 100% rename from examples/wildfly-demo/third-party-cdi/src/main/webapp/WEB-INF/keycloak.json rename to examples/demo-template/third-party-cdi/src/main/webapp/WEB-INF/keycloak.json diff --git a/examples/as7-eap-demo/third-party-cdi/src/main/webapp/WEB-INF/web.xml b/examples/demo-template/third-party-cdi/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from examples/as7-eap-demo/third-party-cdi/src/main/webapp/WEB-INF/web.xml rename to examples/demo-template/third-party-cdi/src/main/webapp/WEB-INF/web.xml diff --git a/examples/as7-eap-demo/third-party-cdi/src/main/webapp/client.xhtml b/examples/demo-template/third-party-cdi/src/main/webapp/client.xhtml old mode 100644 new mode 100755 similarity index 100% rename from examples/as7-eap-demo/third-party-cdi/src/main/webapp/client.xhtml rename to examples/demo-template/third-party-cdi/src/main/webapp/client.xhtml diff --git a/examples/as7-eap-demo/third-party-cdi/src/main/webapp/index.html b/examples/demo-template/third-party-cdi/src/main/webapp/index.html old mode 100644 new mode 100755 similarity index 100% rename from examples/as7-eap-demo/third-party-cdi/src/main/webapp/index.html rename to examples/demo-template/third-party-cdi/src/main/webapp/index.html diff --git a/examples/as7-eap-demo/third-party/pom.xml b/examples/demo-template/third-party/pom.xml similarity index 94% rename from examples/as7-eap-demo/third-party/pom.xml rename to examples/demo-template/third-party/pom.xml index 89372bcdf7..89bea7fd52 100755 --- a/examples/as7-eap-demo/third-party/pom.xml +++ b/examples/demo-template/third-party/pom.xml @@ -8,7 +8,7 @@ ../../../pom.xml 4.0.0 - org.keycloak.example.as7.demo + org.keycloak.example.demo oauth-client-example war Simple OAuth Client diff --git a/examples/as7-eap-demo/third-party/src/main/java/org/keycloak/example/oauth/Bootstrap.java b/examples/demo-template/third-party/src/main/java/org/keycloak/example/oauth/Bootstrap.java similarity index 100% rename from examples/as7-eap-demo/third-party/src/main/java/org/keycloak/example/oauth/Bootstrap.java rename to examples/demo-template/third-party/src/main/java/org/keycloak/example/oauth/Bootstrap.java diff --git a/examples/as7-eap-demo/third-party/src/main/java/org/keycloak/example/oauth/ProductDatabaseClient.java b/examples/demo-template/third-party/src/main/java/org/keycloak/example/oauth/ProductDatabaseClient.java similarity index 100% rename from examples/as7-eap-demo/third-party/src/main/java/org/keycloak/example/oauth/ProductDatabaseClient.java rename to examples/demo-template/third-party/src/main/java/org/keycloak/example/oauth/ProductDatabaseClient.java diff --git a/examples/wildfly-demo/third-party/src/main/webapp/WEB-INF/keycloak.json b/examples/demo-template/third-party/src/main/webapp/WEB-INF/keycloak.json similarity index 100% rename from examples/wildfly-demo/third-party/src/main/webapp/WEB-INF/keycloak.json rename to examples/demo-template/third-party/src/main/webapp/WEB-INF/keycloak.json diff --git a/examples/as7-eap-demo/third-party/src/main/webapp/WEB-INF/web.xml b/examples/demo-template/third-party/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from examples/as7-eap-demo/third-party/src/main/webapp/WEB-INF/web.xml rename to examples/demo-template/third-party/src/main/webapp/WEB-INF/web.xml diff --git a/examples/as7-eap-demo/third-party/src/main/webapp/index.html b/examples/demo-template/third-party/src/main/webapp/index.html old mode 100644 new mode 100755 similarity index 100% rename from examples/as7-eap-demo/third-party/src/main/webapp/index.html rename to examples/demo-template/third-party/src/main/webapp/index.html diff --git a/examples/as7-eap-demo/third-party/src/main/webapp/pull_data.jsp b/examples/demo-template/third-party/src/main/webapp/pull_data.jsp similarity index 100% rename from examples/as7-eap-demo/third-party/src/main/webapp/pull_data.jsp rename to examples/demo-template/third-party/src/main/webapp/pull_data.jsp diff --git a/examples/as7-eap-demo/third-party/src/main/webapp/redirect.jsp b/examples/demo-template/third-party/src/main/webapp/redirect.jsp similarity index 100% rename from examples/as7-eap-demo/third-party/src/main/webapp/redirect.jsp rename to examples/demo-template/third-party/src/main/webapp/redirect.jsp diff --git a/examples/pom.xml b/examples/pom.xml index d44bde6d2c..8ca74f01bb 100755 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -34,7 +34,6 @@ - as7-eap-demo - wildfly-demo + demo-template diff --git a/examples/wildfly-demo/customer-app/pom.xml b/examples/wildfly-demo/customer-app/pom.xml deleted file mode 100755 index e01a111243..0000000000 --- a/examples/wildfly-demo/customer-app/pom.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - keycloak-parent - org.keycloak - 1.0-alpha-1-SNAPSHOT - ../../../pom.xml - - 4.0.0 - org.keycloak.example.wildfly.demo - customer-portal-example - war - Customer Portal - Secured via Valve - - - - - jboss - jboss repo - http://repository.jboss.org/nexus/content/groups/public/ - - - - - - org.jboss.spec.javax.servlet - jboss-servlet-api_3.0_spec - provided - - - org.keycloak - keycloak-undertow-adapter - ${project.version} - provided - - - - - customer-portal - - - org.jboss.as.plugins - jboss-as-maven-plugin - 7.4.Final - - - org.apache.maven.plugins - maven-deploy-plugin - - true - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.6 - 1.6 - - - - - diff --git a/examples/wildfly-demo/customer-app/src/main/webapp/WEB-INF/keycloak.json b/examples/wildfly-demo/customer-app/src/main/webapp/WEB-INF/keycloak.json deleted file mode 100755 index 644d621063..0000000000 --- a/examples/wildfly-demo/customer-app/src/main/webapp/WEB-INF/keycloak.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "realm" : "demo", - "resource" : "customer-portal", - "realm-public-key" : "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQAB", - "auth-server-url" : "http://localhost:8080/auth", - "ssl-not-required" : true, - "expose-token" : true, - "credentials" : { - "password" : "password" - } -} diff --git a/examples/wildfly-demo/customer-app/src/main/webapp/admin/admin.jsp b/examples/wildfly-demo/customer-app/src/main/webapp/admin/admin.jsp deleted file mode 100755 index 39c2a439fe..0000000000 --- a/examples/wildfly-demo/customer-app/src/main/webapp/admin/admin.jsp +++ /dev/null @@ -1,11 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" - pageEncoding="ISO-8859-1"%> - - - Customer Admin Interface - - -

Customer Admin Interface

-User <%=request.getUserPrincipal().getName()%> made this request. - - \ No newline at end of file diff --git a/examples/wildfly-demo/customer-app/src/main/webapp/customers/cors-test.html b/examples/wildfly-demo/customer-app/src/main/webapp/customers/cors-test.html deleted file mode 100755 index bc5456cceb..0000000000 --- a/examples/wildfly-demo/customer-app/src/main/webapp/customers/cors-test.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - diff --git a/examples/wildfly-demo/customer-app/src/main/webapp/customers/view.jsp b/examples/wildfly-demo/customer-app/src/main/webapp/customers/view.jsp deleted file mode 100755 index 44f6fb44e3..0000000000 --- a/examples/wildfly-demo/customer-app/src/main/webapp/customers/view.jsp +++ /dev/null @@ -1,30 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" - pageEncoding="ISO-8859-1"%> -<%@ page import="org.keycloak.example.CustomerDatabaseClient" %> -<%@ page import="org.keycloak.util.KeycloakUriBuilder" %> - - - Customer View Page - - -<% - String logoutUri = KeycloakUriBuilder.fromUri("http://localhost:8080/auth/rest/realms/demo/tokens/logout") - .queryParam("redirect_uri", "http://localhost:8080/customer-portal").build().toString(); - String acctUri = "http://localhost:8080/auth/rest/realms/demo/account"; -%> -

Goto: products | logout | manage acct

-User <%=request.getUserPrincipal().getName()%> made this request. -

Customer Listing

-<% -java.util.List list = CustomerDatabaseClient.getCustomers(request); -for (String cust : list) -{ - out.print("

"); - out.print(cust); - out.println("

"); - -} -%> -

- - \ No newline at end of file diff --git a/examples/wildfly-demo/customer-app/src/main/webapp/index.html b/examples/wildfly-demo/customer-app/src/main/webapp/index.html deleted file mode 100644 index 7b164dfeaf..0000000000 --- a/examples/wildfly-demo/customer-app/src/main/webapp/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - -

Customer Portal

- -

Customer Listing

-

Customer Admin Interface

- - - \ No newline at end of file diff --git a/examples/wildfly-demo/database-service/src/main/java/org/keycloak/example/oauth/CustomerService.java b/examples/wildfly-demo/database-service/src/main/java/org/keycloak/example/oauth/CustomerService.java deleted file mode 100644 index a041476b44..0000000000 --- a/examples/wildfly-demo/database-service/src/main/java/org/keycloak/example/oauth/CustomerService.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.keycloak.example.oauth; - -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import java.util.ArrayList; -import java.util.List; - -/** - * @author Bill Burke - * @version $Revision: 1 $ - */ -@Path("customers") -public class CustomerService -{ - @GET - @Produces("application/json") - public List getCustomers() - { - ArrayList rtn = new ArrayList(); - rtn.add("Bill Burke"); - rtn.add("Ron Sigal"); - rtn.add("Weinan Li"); - return rtn; - } -} diff --git a/examples/wildfly-demo/database-service/src/main/java/org/keycloak/example/oauth/DataApplication.java b/examples/wildfly-demo/database-service/src/main/java/org/keycloak/example/oauth/DataApplication.java deleted file mode 100644 index 4a2ce3e565..0000000000 --- a/examples/wildfly-demo/database-service/src/main/java/org/keycloak/example/oauth/DataApplication.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.keycloak.example.oauth; - -import javax.ws.rs.ApplicationPath; -import javax.ws.rs.core.Application; - -/** - * @author Bill Burke - * @version $Revision: 1 $ - */ -@ApplicationPath("/") -public class DataApplication extends Application -{ -} diff --git a/examples/wildfly-demo/database-service/src/main/java/org/keycloak/example/oauth/ProductService.java b/examples/wildfly-demo/database-service/src/main/java/org/keycloak/example/oauth/ProductService.java deleted file mode 100644 index c7f8f4d208..0000000000 --- a/examples/wildfly-demo/database-service/src/main/java/org/keycloak/example/oauth/ProductService.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.keycloak.example.oauth; - -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import java.util.ArrayList; -import java.util.List; - -/** - * @author Bill Burke - * @version $Revision: 1 $ - */ -@Path("products") -public class ProductService -{ - @GET - @Produces("application/json") - public List getProducts() - { - ArrayList rtn = new ArrayList(); - rtn.add("iphone"); - rtn.add("ipad"); - rtn.add("ipod"); - return rtn; - } -} diff --git a/examples/wildfly-demo/product-app/src/main/java/org/keycloak/example/oauth/ProductDatabaseClient.java b/examples/wildfly-demo/product-app/src/main/java/org/keycloak/example/oauth/ProductDatabaseClient.java deleted file mode 100755 index e512597bed..0000000000 --- a/examples/wildfly-demo/product-app/src/main/java/org/keycloak/example/oauth/ProductDatabaseClient.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.keycloak.example.oauth; - -import org.apache.http.HttpEntity; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpGet; -import org.keycloak.SkeletonKeySession; -import org.keycloak.adapters.HttpClientBuilder; -import org.keycloak.util.JsonSerialization; - -import javax.servlet.http.HttpServletRequest; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; - -/** - * @author Bill Burke - * @version $Revision: 1 $ - */ -public class ProductDatabaseClient -{ - static class TypedList extends ArrayList {} - - public static List getProducts(HttpServletRequest req) { - SkeletonKeySession session = (SkeletonKeySession)req.getAttribute(SkeletonKeySession.class.getName()); - HttpClient client = new HttpClientBuilder() - .trustStore(session.getMetadata().getTruststore()) - .hostnameVerification(HttpClientBuilder.HostnameVerificationPolicy.ANY).build(); - try { - HttpGet get = new HttpGet("http://localhost:8080/database/products"); - get.addHeader("Authorization", "Bearer " + session.getTokenString()); - try { - HttpResponse response = client.execute(get); - HttpEntity entity = response.getEntity(); - InputStream is = entity.getContent(); - try { - return JsonSerialization.readValue(is, TypedList.class); - } finally { - is.close(); - } - } catch (IOException e) { - throw new RuntimeException(e); - } - } finally { - client.getConnectionManager().shutdown(); - } - } - -} diff --git a/examples/wildfly-demo/product-app/src/main/webapp/admin/admin.jsp b/examples/wildfly-demo/product-app/src/main/webapp/admin/admin.jsp deleted file mode 100644 index b6448d7738..0000000000 --- a/examples/wildfly-demo/product-app/src/main/webapp/admin/admin.jsp +++ /dev/null @@ -1,11 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" - pageEncoding="ISO-8859-1"%> - - - Product Admin Interface - - -

Product Admin Interface

-User <%=request.getUserPrincipal().getName()%> made this request. - - \ No newline at end of file diff --git a/examples/wildfly-demo/product-app/src/main/webapp/index.html b/examples/wildfly-demo/product-app/src/main/webapp/index.html deleted file mode 100644 index e30ebc5c1c..0000000000 --- a/examples/wildfly-demo/product-app/src/main/webapp/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - -

Product Portal

- -

Product Listing

-

Admin Interface

- - - \ No newline at end of file diff --git a/examples/wildfly-demo/product-app/src/main/webapp/products/view.jsp b/examples/wildfly-demo/product-app/src/main/webapp/products/view.jsp deleted file mode 100755 index f476872a99..0000000000 --- a/examples/wildfly-demo/product-app/src/main/webapp/products/view.jsp +++ /dev/null @@ -1,31 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" - pageEncoding="ISO-8859-1"%> -<%@ page import="org.keycloak.example.oauth.ProductDatabaseClient" %> -<%@ page import="org.keycloak.util.KeycloakUriBuilder" %> - - - Product View Page - - -<% - String logoutUri = KeycloakUriBuilder.fromUri("http://localhost:8080/auth/rest/realms/demo/tokens/logout") - .queryParam("redirect_uri", "http://localhost:8080/product-portal").build().toString(); - String acctUri = "http://localhost:8080/auth/rest/realms/demo/account"; -%> - -

Goto: customers | logout | manage acct

-User <%=request.getUserPrincipal().getName()%> made this request. -

Product Listing

-<% -java.util.List list = ProductDatabaseClient.getProducts(request); -for (String cust : list) -{ - out.print("

"); - out.print(cust); - out.println("

"); - -} -%> -

- - \ No newline at end of file diff --git a/examples/wildfly-demo/testrealm.json b/examples/wildfly-demo/testrealm.json deleted file mode 100755 index f9354df4c8..0000000000 --- a/examples/wildfly-demo/testrealm.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "realm": "demo", - "enabled": true, - "tokenLifespan": 3000, - "accessCodeLifespan": 10, - "accessCodeLifespanUserAction": 6000, - "accountManagement": true, - "sslNotRequired": true, - "registrationAllowed": false, - "social": false, - "automaticRegistrationAfterSocialLogin": 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" ], - "requiredApplicationCredentials": [ "password" ], - "requiredOAuthClientCredentials": [ "password" ], - "users" : [ - { - "username" : "bburke@redhat.com", - "enabled": true, - "attributes" : { - "email" : "bburke@redhat.com" - }, - "credentials" : [ - { "type" : "password", - "value" : "password" } - ] - } - ], - "roles": [ - { - "name": "user", - "description": "User privileges" - }, - { - "name": "admin", - "description": "Administrator privileges" - } - ], - "roleMappings": [ - { - "username": "bburke@redhat.com", - "roles": ["user"] - } - ], - "scopeMappings": [ - { - "username": "third-party", - "roles": ["user"] - }, - { - "username": "customer-portal", - "roles": ["user"] - }, - { - "username": "product-portal", - "roles": ["user"] - } - - ], - "applications": [ - { - "name": "customer-portal", - "enabled": true, - "adminUrl": "http://localhost:8080/customer-portal", - "credentials": [ - { - "type": "password", - "value": "password" - } - ] - }, - { - "name": "product-portal", - "enabled": true, - "adminUrl": "http://localhost:8080/product-portal", - "credentials": [ - { - "type": "password", - "value": "password" - } - ] - } - ], - "oauthClients": [ - { - "name": "third-party", - "enabled": true, - "credentials": [ - { - "type": "password", - "value": "password" - } - ] - } - ], - "applicationRoleMappings": { - "account": [ - { - "username": "bburke@redhat.com", - "roles": ["manage-account"] - } - ] - } - -} diff --git a/examples/wildfly-demo/third-party-cdi/pom.xml b/examples/wildfly-demo/third-party-cdi/pom.xml deleted file mode 100755 index 27784e333d..0000000000 --- a/examples/wildfly-demo/third-party-cdi/pom.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - keycloak-parent - org.keycloak - 1.0-alpha-1-SNAPSHOT - ../../../pom.xml - - 4.0.0 - org.keycloak.example.wildfly.demo - oauth-client-cdi-example - war - Simple OAuth Client Using CDI and JSF - - - - - org.jboss.spec.javax.servlet - jboss-servlet-api_3.0_spec - 1.0.1.Final - provided - - - javax.enterprise - cdi-api - 1.0-SP4 - provided - - - org.jboss.spec.javax.faces - jboss-jsf-api_2.1_spec - 2.0.1.Final - provided - - - org.jboss.logging - jboss-logging - 3.1.2.GA - provided - - - org.keycloak - keycloak-servlet-oauth-client - ${project.version} - - - - - oauth-client-cdi - - - org.jboss.as.plugins - jboss-as-maven-plugin - 7.4.Final - - - org.apache.maven.plugins - maven-deploy-plugin - - true - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.6 - 1.6 - - - - - diff --git a/examples/wildfly-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/AppContextListener.java b/examples/wildfly-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/AppContextListener.java deleted file mode 100644 index f84019e530..0000000000 --- a/examples/wildfly-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/AppContextListener.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.keycloak.example.oauth; - -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.InputStream; - -import javax.inject.Inject; -import javax.servlet.ServletContext; -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletContextListener; -import javax.servlet.annotation.WebListener; - -import org.jboss.logging.Logger; -import org.keycloak.servlet.ServletOAuthClient; -import org.keycloak.servlet.ServletOAuthClientConfigLoader; - -/** - * @author Marek Posolda - */ -@WebListener -public class AppContextListener implements ServletContextListener { - - private static final Logger logger = Logger.getLogger(AppContextListener.class); - - @Inject - private ServletOAuthClient oauthClient; - - @Override - public void contextInitialized(ServletContextEvent sce) { - ServletContext context = sce.getServletContext(); - - InputStream is = null; - String path = context.getInitParameter("keycloak.config.file"); - if (path == null) { - is = context.getResourceAsStream("/WEB-INF/keycloak.json"); - } else { - try { - is = new FileInputStream(path); - } catch (FileNotFoundException e) { - throw new RuntimeException(e); - } - } - - ServletOAuthClientConfigLoader loader = new ServletOAuthClientConfigLoader(is); - loader.initOAuthClientConfiguration(true); - loader.configureServletOAuthClient(oauthClient); - - oauthClient.start(); - logger.info("OAuth client configured and started"); - } - - @Override - public void contextDestroyed(ServletContextEvent sce) { - oauthClient.stop(); - logger.info("OAuth client stopped"); - } -} diff --git a/examples/wildfly-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/CDIResourcesProducer.java b/examples/wildfly-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/CDIResourcesProducer.java deleted file mode 100644 index fd5e45843e..0000000000 --- a/examples/wildfly-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/CDIResourcesProducer.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.keycloak.example.oauth; - -import javax.enterprise.context.ApplicationScoped; -import javax.enterprise.context.RequestScoped; -import javax.enterprise.inject.Produces; -import javax.faces.context.FacesContext; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.keycloak.servlet.ServletOAuthClient; - -/** - * @author Marek Posolda - */ -public class CDIResourcesProducer { - - @Produces - @RequestScoped - public FacesContext produceFacesContext() { - return FacesContext.getCurrentInstance(); - } - - @Produces - @RequestScoped - @ServletRequestQualifier - public HttpServletRequest produceServletRequest() { - return (HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest(); - } - - @Produces - @RequestScoped - public HttpServletResponse produceServletResponse() { - return (HttpServletResponse)FacesContext.getCurrentInstance().getExternalContext().getResponse(); - } - - @Produces - @ApplicationScoped - public ServletOAuthClient produceOAuthClient() { - return new ServletOAuthClient(); - } -} diff --git a/examples/wildfly-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/DatabaseClient.java b/examples/wildfly-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/DatabaseClient.java deleted file mode 100755 index 17f7fd2832..0000000000 --- a/examples/wildfly-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/DatabaseClient.java +++ /dev/null @@ -1,104 +0,0 @@ -package org.keycloak.example.oauth; - -import org.apache.http.HttpEntity; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpGet; -import org.jboss.logging.Logger; -import org.keycloak.adapters.TokenGrantRequest; -import org.keycloak.servlet.ServletOAuthClient; -import org.keycloak.util.JsonSerialization; - -import javax.enterprise.context.ApplicationScoped; -import javax.faces.application.FacesMessage; -import javax.faces.context.FacesContext; -import javax.inject.Inject; -import javax.inject.Named; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; - -/** - * @author Bill Burke - * @author Marek Posolda - * @version $Revision: 1 $ - */ -@ApplicationScoped -@Named("databaseClient") -public class DatabaseClient { - - @Inject - @ServletRequestQualifier - private HttpServletRequest request; - - @Inject - private HttpServletResponse response; - - @Inject - private FacesContext facesContext; - - @Inject - private ServletOAuthClient oauthClient; - - @Inject - private UserData userData; - - private static final Logger logger = Logger.getLogger(DatabaseClient.class); - - public void retrieveAccessToken() { - try { - oauthClient.redirectRelative("client.jsf", request, response); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - static class TypedList extends ArrayList {} - - public void sendCustomersRequest() { - List customers = sendRequestToDBApplication("http://localhost:8080/database/customers"); - userData.setCustomers(customers); - } - - public void sendProductsRequest() { - List products = sendRequestToDBApplication("http://localhost:8080/database/products"); - userData.setProducts(products); - } - - protected List sendRequestToDBApplication(String dbUri) { - HttpClient client = oauthClient.getClient(); - HttpGet get = new HttpGet(dbUri); - try { - - if (userData.isHasAccessToken()) { - get.addHeader("Authorization", "Bearer " + userData.getAccessToken()); - } - - HttpResponse response = client.execute(get); - switch (response.getStatusLine().getStatusCode()) { - case 200: HttpEntity entity = response.getEntity(); - InputStream is = entity.getContent(); - try { - return JsonSerialization.readValue(is, TypedList.class); - } finally { - is.close(); - } - case 401: facesContext.addMessage(null, new FacesMessage("Status: 401. Request not authenticated! You need to retrieve access token first.")); - break; - case 403: facesContext.addMessage(null, new FacesMessage("Status: 403. Access token has insufficient privileges")); - break; - default: facesContext.addMessage(null, new FacesMessage("Status: " + response.getStatusLine() + ". Not able to retrieve data. See log for details")); - logger.warn("Error occured. Status: " + response.getStatusLine()); - } - - return null; - } catch (IOException e) { - e.printStackTrace(); - facesContext.addMessage(null, new FacesMessage("Unknown error. See log for details")); - return null; - } - } -} diff --git a/examples/wildfly-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/MessagesChecker.java b/examples/wildfly-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/MessagesChecker.java deleted file mode 100644 index e59864f5bf..0000000000 --- a/examples/wildfly-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/MessagesChecker.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.keycloak.example.oauth; - -import javax.enterprise.context.RequestScoped; -import javax.faces.application.FacesMessage; -import javax.faces.context.FacesContext; -import javax.inject.Inject; -import javax.inject.Named; -import javax.servlet.http.HttpServletRequest; - -/** - * This is needed because Faces context is not available in HTTP filters - * - * @author Marek Posolda - */ -@RequestScoped -@Named("messagesChecker") -public class MessagesChecker { - - @Inject - @ServletRequestQualifier - private HttpServletRequest request; - - @Inject - private FacesContext facesContext; - - public String getCheckMessage() { - String oauthError = (String)request.getAttribute(RefreshTokenFilter.OAUTH_ERROR_ATTR); - if (oauthError != null) { - facesContext.addMessage(null, new FacesMessage("OAuth error occured: " + oauthError)); - } - - return null; - } -} diff --git a/examples/wildfly-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/RefreshTokenFilter.java b/examples/wildfly-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/RefreshTokenFilter.java deleted file mode 100644 index 7467959298..0000000000 --- a/examples/wildfly-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/RefreshTokenFilter.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.keycloak.example.oauth; - -import java.io.IOException; -import java.util.Map; - -import javax.inject.Inject; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.annotation.WebFilter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.keycloak.adapters.TokenGrantRequest; -import org.keycloak.servlet.ServletOAuthClient; - -/** - * @author Marek Posolda - */ -@WebFilter(value = "/client.jsf") -public class RefreshTokenFilter implements Filter { - - public static final String OAUTH_ERROR_ATTR = "oauthErrorAttr"; - - @Inject - private ServletOAuthClient oauthClient; - - @Inject - private UserData userData; - - @Override - public void init(FilterConfig filterConfig) throws ServletException { - } - - @Override - public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException { - HttpServletRequest request = (HttpServletRequest)req; - HttpServletResponse response = (HttpServletResponse)resp; - Map reqParams = request.getParameterMap(); - - if (reqParams.containsKey("code")) { - try { - String accessToken = oauthClient.getBearerToken(request); - userData.setAccessToken(accessToken); - } catch (TokenGrantRequest.HttpFailure e) { - throw new ServletException(e); - } - } else if (reqParams.containsKey("error")) { - String oauthError = reqParams.get("error")[0]; - request.setAttribute(OAUTH_ERROR_ATTR, oauthError); - } - - chain.doFilter(request, response); - } - - @Override - public void destroy() { - } -} diff --git a/examples/wildfly-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/ServletRequestQualifier.java b/examples/wildfly-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/ServletRequestQualifier.java deleted file mode 100644 index 5f7edca722..0000000000 --- a/examples/wildfly-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/ServletRequestQualifier.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.keycloak.example.oauth; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import javax.inject.Qualifier; - -/** - * This is needed to have same code working in AS7 and Wildfly. In Wildfly is HttpServletRequest injected automatically, in AS7 it's not - * - * @author Marek Posolda - */ -@Qualifier -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER }) -public @interface ServletRequestQualifier { -} diff --git a/examples/wildfly-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/UserData.java b/examples/wildfly-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/UserData.java deleted file mode 100644 index 6571b18f3a..0000000000 --- a/examples/wildfly-demo/third-party-cdi/src/main/java/org/keycloak/example/oauth/UserData.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.keycloak.example.oauth; - -import java.io.Serializable; -import java.util.List; - -import javax.enterprise.context.SessionScoped; -import javax.inject.Named; - -/** - * @author Marek Posolda - */ -@SessionScoped -@Named("userData") -public class UserData implements Serializable { - - private String accessToken; - private List products; - private List customers; - - public String getAccessToken() { - return accessToken; - } - - public void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - - public boolean isHasAccessToken() { - return accessToken != null; - } - - public String getAccessTokenAvailabilityMessage() { - StringBuilder builder = new StringBuilder("Access token "); - if (!isHasAccessToken()) { - builder.append("not "); - } - return builder.append("available!").toString(); - } - - public List getProducts() { - return products; - } - - public void setProducts(List products) { - this.products = products; - } - - public boolean isHasProducts() { - return products != null; - } - - public List getCustomers() { - return customers; - } - - public void setCustomers(List customers) { - this.customers = customers; - } - - public boolean isHasCustomers() { - return customers != null; - } -} diff --git a/examples/wildfly-demo/third-party-cdi/src/main/webapp/WEB-INF/beans.xml b/examples/wildfly-demo/third-party-cdi/src/main/webapp/WEB-INF/beans.xml deleted file mode 100644 index c4feade019..0000000000 --- a/examples/wildfly-demo/third-party-cdi/src/main/webapp/WEB-INF/beans.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - \ No newline at end of file diff --git a/examples/wildfly-demo/third-party-cdi/src/main/webapp/WEB-INF/faces-config.xml b/examples/wildfly-demo/third-party-cdi/src/main/webapp/WEB-INF/faces-config.xml deleted file mode 100644 index 10787a09a9..0000000000 --- a/examples/wildfly-demo/third-party-cdi/src/main/webapp/WEB-INF/faces-config.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/examples/wildfly-demo/third-party-cdi/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/examples/wildfly-demo/third-party-cdi/src/main/webapp/WEB-INF/jboss-deployment-structure.xml deleted file mode 100755 index c54e4abec6..0000000000 --- a/examples/wildfly-demo/third-party-cdi/src/main/webapp/WEB-INF/jboss-deployment-structure.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/examples/wildfly-demo/third-party-cdi/src/main/webapp/WEB-INF/web.xml b/examples/wildfly-demo/third-party-cdi/src/main/webapp/WEB-INF/web.xml deleted file mode 100755 index 93e1ef63c4..0000000000 --- a/examples/wildfly-demo/third-party-cdi/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - oauth-client-cdi - - - - diff --git a/examples/wildfly-demo/third-party-cdi/src/main/webapp/client.xhtml b/examples/wildfly-demo/third-party-cdi/src/main/webapp/client.xhtml deleted file mode 100644 index 7c4a8dd7c2..0000000000 --- a/examples/wildfly-demo/third-party-cdi/src/main/webapp/client.xhtml +++ /dev/null @@ -1,37 +0,0 @@ - - - -

Third Party App That Pulls Data Using OAuth

- - #{userData.accessTokenAvailabilityMessage} -
- - - -
- - -
-

Products data available

- - #{product}
-
-
- - -
-

Customers data available

- - #{customer}
-
-
- -
- #{messagesChecker.checkMessage} - -
- - diff --git a/examples/wildfly-demo/third-party-cdi/src/main/webapp/index.html b/examples/wildfly-demo/third-party-cdi/src/main/webapp/index.html deleted file mode 100644 index 7b641f77fd..0000000000 --- a/examples/wildfly-demo/third-party-cdi/src/main/webapp/index.html +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/examples/wildfly-demo/third-party/pom.xml b/examples/wildfly-demo/third-party/pom.xml deleted file mode 100755 index b708b835a2..0000000000 --- a/examples/wildfly-demo/third-party/pom.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - keycloak-parent - org.keycloak - 1.0-alpha-1-SNAPSHOT - ../../../pom.xml - - 4.0.0 - org.keycloak.example.wildfly.demo - oauth-client-example - war - Simple OAuth Client - - - - - org.jboss.spec.javax.servlet - jboss-servlet-api_3.0_spec - 1.0.1.Final - provided - - - org.keycloak - keycloak-servlet-oauth-client - ${project.version} - - - - - oauth-client - - - org.jboss.as.plugins - jboss-as-maven-plugin - 7.4.Final - - - org.apache.maven.plugins - maven-deploy-plugin - - true - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.6 - 1.6 - - - - - diff --git a/examples/wildfly-demo/third-party/src/main/java/org/keycloak/example/oauth/Bootstrap.java b/examples/wildfly-demo/third-party/src/main/java/org/keycloak/example/oauth/Bootstrap.java deleted file mode 100755 index 7b8bec2a16..0000000000 --- a/examples/wildfly-demo/third-party/src/main/java/org/keycloak/example/oauth/Bootstrap.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.keycloak.example.oauth; - -import org.keycloak.servlet.ServletOAuthClient; -import org.keycloak.servlet.ServletOAuthClientConfigLoader; - -import javax.servlet.ServletContext; -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletContextListener; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.InputStream; -import java.security.KeyStore; - -/** - * Init code to load up the truststore so we can make appropriate SSL connections - * You really should use a better way of initializing this stuff. - * - * @author Bill Burke - * @version $Revision: 1 $ - */ -public class Bootstrap implements ServletContextListener { - - private ServletOAuthClient client; - - private static KeyStore loadKeyStore(String filename, String password) throws Exception { - KeyStore trustStore = KeyStore.getInstance(KeyStore - .getDefaultType()); - File truststoreFile = new File(filename); - FileInputStream trustStream = new FileInputStream(truststoreFile); - trustStore.load(trustStream, password.toCharArray()); - trustStream.close(); - return trustStore; - } - - @Override - public void contextInitialized(ServletContextEvent sce) { - client = new ServletOAuthClient(); - ServletContext context = sce.getServletContext(); - - configureClient(context); - - client.start(); - context.setAttribute(ServletOAuthClient.class.getName(), client); - } - - @Override - public void contextDestroyed(ServletContextEvent sce) { - client.stop(); - } - - private void configureClient(ServletContext context) { - InputStream is = null; - String path = context.getInitParameter("keycloak.config.file"); - if (path == null) { - is = context.getResourceAsStream("/WEB-INF/keycloak.json"); - } else { - try { - is = new FileInputStream(path); - } catch (FileNotFoundException e) { - throw new RuntimeException(e); - } - } - - ServletOAuthClientConfigLoader loader = new ServletOAuthClientConfigLoader(is); - loader.initOAuthClientConfiguration(true); - loader.configureServletOAuthClient(client); - } -} diff --git a/examples/wildfly-demo/third-party/src/main/java/org/keycloak/example/oauth/ProductDatabaseClient.java b/examples/wildfly-demo/third-party/src/main/java/org/keycloak/example/oauth/ProductDatabaseClient.java deleted file mode 100755 index a1983dc81e..0000000000 --- a/examples/wildfly-demo/third-party/src/main/java/org/keycloak/example/oauth/ProductDatabaseClient.java +++ /dev/null @@ -1,72 +0,0 @@ -package org.keycloak.example.oauth; - -import org.apache.http.HttpEntity; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpGet; -import org.keycloak.adapters.TokenGrantRequest; -import org.keycloak.servlet.ServletOAuthClient; -import org.keycloak.util.JsonSerialization; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; - -/** - * @author Bill Burke - * @version $Revision: 1 $ - */ -public class ProductDatabaseClient { - public static void redirect(HttpServletRequest request, HttpServletResponse response) { - // The ServletOAuthClient is obtained by getting a context attribute - // that is set in the Bootstrap context listener in this project. - // You really should come up with a better way to initialize - // and obtain the ServletOAuthClient. I actually suggest downloading the ServletOAuthClient code - // and take a look how it works. You can also take a look at third-party-cdi example - ServletOAuthClient oAuthClient = (ServletOAuthClient) request.getServletContext().getAttribute(ServletOAuthClient.class.getName()); - try { - oAuthClient.redirectRelative("pull_data.jsp", request, response); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - static class TypedList extends ArrayList {} - - public static List getProducts(HttpServletRequest request) { - // The ServletOAuthClient is obtained by getting a context attribute - // that is set in the Bootstrap context listener in this project. - // You really should come up with a better way to initialize - // and obtain the ServletOAuthClient. I actually suggest downloading the ServletOAuthClient code - // and take a look how it works. You can also take a look at third-party-cdi example - ServletOAuthClient oAuthClient = (ServletOAuthClient) request.getServletContext().getAttribute(ServletOAuthClient.class.getName()); - String token = null; - try { - token = oAuthClient.getBearerToken(request); - } catch (IOException e) { - throw new RuntimeException(e); - } catch (TokenGrantRequest.HttpFailure failure) { - throw new RuntimeException(failure); - } - - HttpClient client = oAuthClient.getClient(); - - HttpGet get = new HttpGet("http://localhost:8080/database/products"); - get.addHeader("Authorization", "Bearer " + token); - try { - HttpResponse response = client.execute(get); - HttpEntity entity = response.getEntity(); - InputStream is = entity.getContent(); - try { - return JsonSerialization.readValue(is, TypedList.class); - } finally { - is.close(); - } - } catch (IOException e) { - throw new RuntimeException(e); - } - } -} diff --git a/examples/wildfly-demo/third-party/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/examples/wildfly-demo/third-party/src/main/webapp/WEB-INF/jboss-deployment-structure.xml deleted file mode 100755 index c54e4abec6..0000000000 --- a/examples/wildfly-demo/third-party/src/main/webapp/WEB-INF/jboss-deployment-structure.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/examples/wildfly-demo/third-party/src/main/webapp/WEB-INF/web.xml b/examples/wildfly-demo/third-party/src/main/webapp/WEB-INF/web.xml deleted file mode 100755 index 958839db9f..0000000000 --- a/examples/wildfly-demo/third-party/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - oauth-client - - - org.keycloak.example.oauth.Bootstrap - - - - diff --git a/examples/wildfly-demo/third-party/src/main/webapp/index.html b/examples/wildfly-demo/third-party/src/main/webapp/index.html deleted file mode 100644 index dbd7d7ac6f..0000000000 --- a/examples/wildfly-demo/third-party/src/main/webapp/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - -

Third Party App That Pulls Data Using OAuth

-Pull Data - - \ No newline at end of file diff --git a/examples/wildfly-demo/third-party/src/main/webapp/pull_data.jsp b/examples/wildfly-demo/third-party/src/main/webapp/pull_data.jsp deleted file mode 100755 index a64f674d50..0000000000 --- a/examples/wildfly-demo/third-party/src/main/webapp/pull_data.jsp +++ /dev/null @@ -1,22 +0,0 @@ -<%@ page import="org.keycloak.example.oauth.ProductDatabaseClient" %> -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" - pageEncoding="ISO-8859-1"%> - - - Pull Page - - -

Pulled Product Listing

-<% -java.util.List list = ProductDatabaseClient.getProducts(request); -for (String prod : list) -{ - out.print("

"); - out.print(prod); - out.println("

"); - -} -%> -

- - \ No newline at end of file diff --git a/examples/wildfly-demo/third-party/src/main/webapp/redirect.jsp b/examples/wildfly-demo/third-party/src/main/webapp/redirect.jsp deleted file mode 100755 index c74a9ae9e5..0000000000 --- a/examples/wildfly-demo/third-party/src/main/webapp/redirect.jsp +++ /dev/null @@ -1,3 +0,0 @@ -<%@ page import="org.keycloak.example.oauth.ProductDatabaseClient" %><% - ProductDatabaseClient.redirect(request, response); -%> \ No newline at end of file