diff --git a/distribution/examples-docs-zip/build.xml b/distribution/examples-docs-zip/build.xml
index a33d88d58c..16f93f5546 100755
--- a/distribution/examples-docs-zip/build.xml
+++ b/distribution/examples-docs-zip/build.xml
@@ -50,6 +50,14 @@
+
+
+
+
+
+
+
+
diff --git a/examples/admin-client/example-realm.json b/examples/admin-client/example-realm.json
new file mode 100755
index 0000000000..2615e56676
--- /dev/null
+++ b/examples/admin-client/example-realm.json
@@ -0,0 +1,37 @@
+{
+ "realm": "example",
+ "enabled": true,
+ "sslRequired": "external",
+ "registrationAllowed": true,
+ "passwordCredentialGrantAllowed": true,
+ "privateKey": "MIICXAIBAAKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQABAoGAfmO8gVhyBxdqlxmIuglbz8bcjQbhXJLR2EoS8ngTXmN1bo2L90M0mUKSdc7qF10LgETBzqL8jYlQIbt+e6TH8fcEpKCjUlyq0Mf/vVbfZSNaVycY13nTzo27iPyWQHK5NLuJzn1xvxxrUeXI6A2WFpGEBLbHjwpx5WQG9A+2scECQQDvdn9NE75HPTVPxBqsEd2z10TKkl9CZxu10Qby3iQQmWLEJ9LNmy3acvKrE3gMiYNWb6xHPKiIqOR1as7L24aTAkEAtyvQOlCvr5kAjVqrEKXalj0Tzewjweuxc0pskvArTI2Oo070h65GpoIKLc9jf+UA69cRtquwP93aZKtW06U8dQJAF2Y44ks/mK5+eyDqik3koCI08qaC8HYq2wVl7G2QkJ6sbAaILtcvD92ToOvyGyeE0flvmDZxMYlvaZnaQ0lcSQJBAKZU6umJi3/xeEbkJqMfeLclD27XGEFoPeNrmdx0q10Azp4NfJAY+Z8KRyQCR2BEG+oNitBOZ+YXF9KCpH3cdmECQHEigJhYg+ykOvr1aiZUMFT72HU0jnmQe2FVekuG+LJUt2Tm7GtMjTFoGpf0JwrVuZN39fOYAlo+nTixgeW7X8Y=",
+ "publicKey": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQAB",
+ "requiredCredentials": [ "password" ],
+ "users": [
+ {
+ "username": "examples-admin-client",
+ "enabled": true,
+ "credentials": [
+ {
+ "type": "password",
+ "value": "password"
+ }
+ ],
+ "applicationRoles": {
+ "realm-management": [ "realm-admin" ]
+ }
+ }
+ ],
+ "applications": [
+ {
+ "name": "examples-admin-client",
+ "enabled": true,
+ "fullScopeAllowed": true,
+ "baseUrl": "/examples-admin-client",
+ "redirectUris": [
+ "/examples-admin-client/*"
+ ],
+ "secret": "password"
+ }
+ ]
+}
diff --git a/examples/admin-client/pom.xml b/examples/admin-client/pom.xml
new file mode 100644
index 0000000000..256089fe74
--- /dev/null
+++ b/examples/admin-client/pom.xml
@@ -0,0 +1,33 @@
+
+ 4.0.0
+
+
+ keycloak-parent
+ org.keycloak
+ 1.1.0-Alpha1-SNAPSHOT
+ ../../pom.xml
+
+
+ Keycloak Examples - Admin Client
+ examples-admin-client
+ war
+
+
+ Keycloak Admin Client Example
+
+
+
+
+ org.keycloak
+ keycloak-admin-client
+ ${project.version}
+
+
+
+
+ ${project.artifactId}
+
+
+
+
diff --git a/examples/admin-client/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/examples/admin-client/src/main/webapp/WEB-INF/jboss-deployment-structure.xml
new file mode 100755
index 0000000000..1ef0bb43a6
--- /dev/null
+++ b/examples/admin-client/src/main/webapp/WEB-INF/jboss-deployment-structure.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/admin-client/src/main/webapp/WEB-INF/web.xml b/examples/admin-client/src/main/webapp/WEB-INF/web.xml
new file mode 100755
index 0000000000..c8dab296f1
--- /dev/null
+++ b/examples/admin-client/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,9 @@
+
+
+
+ examples-admin-client
+
+
diff --git a/examples/admin-client/src/main/webapp/index.jsp b/examples/admin-client/src/main/webapp/index.jsp
new file mode 100644
index 0000000000..13b6eee183
--- /dev/null
+++ b/examples/admin-client/src/main/webapp/index.jsp
@@ -0,0 +1,33 @@
+<%@ page import="org.keycloak.admin.client.Keycloak" %>
+<%@ page import="org.keycloak.admin.client.resource.ApplicationsResource" %>
+<%@ page import="org.keycloak.representations.idm.ApplicationRepresentation" %>
+<%@ page import="org.keycloak.util.UriUtils" %>
+<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %>
+<%@ page session="false" %>
+
+
+ Applications
+
+
+<%
+ String authServer = UriUtils.getOrigin(request.getRequestURL().toString()) + "/auth";
+
+ Keycloak keycloak = Keycloak.getInstance(authServer, "example", "examples-admin-client", "password", "examples-admin-client", "password");
+ ApplicationsResource applications = keycloak.realm("example").applications();
+
+ out.println("Applications
");
+ out.println("");
+ for (ApplicationRepresentation app : applications.findAll()) {
+ out.println("\t- ");
+ if (app.getBaseUrl() != null) {
+ out.println("\t\t" + app.getName() + "");
+ } else {
+ out.println("\t\t" + app.getName());
+ }
+ out.println("
");
+ }
+ out.println("
");
+%>
+
+
+
diff --git a/examples/pom.xml b/examples/pom.xml
index 0428cd2530..61c47af28b 100755
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -25,6 +25,7 @@
+ admin-client
cors
demo-template
providers
diff --git a/integration/admin-client/pom.xml b/integration/admin-client/pom.xml
index 84a35f3d5d..6aa8a2d818 100755
--- a/integration/admin-client/pom.xml
+++ b/integration/admin-client/pom.xml
@@ -23,31 +23,37 @@
org.codehaus.jackson
jackson-mapper-asl
+ provided
org.apache.httpcomponents
httpclient
${keycloak.apache.httpcomponents.version}
+ provided
org.jboss.resteasy
jaxrs-api
${resteasy.version.latest}
+ provided
org.jboss.resteasy
resteasy-jaxrs
${resteasy.version.latest}
+ provided
org.jboss.resteasy
resteasy-client
${resteasy.version.latest}
+ provided
org.jboss.resteasy
resteasy-jackson-provider
${resteasy.version.latest}
+ provided