();
- rtn.add("iphone");
- rtn.add("ipad");
- rtn.add("ipod");
- return rtn;
- }
-}
diff --git a/bundled-war-example/src/main/resources/META-INF/beans.xml b/bundled-war-example/src/main/resources/META-INF/beans.xml
deleted file mode 100644
index 57025b5976..0000000000
--- a/bundled-war-example/src/main/resources/META-INF/beans.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/bundled-war-example/src/main/resources/META-INF/persistence.xml b/bundled-war-example/src/main/resources/META-INF/persistence.xml
deleted file mode 100755
index 616f8e8c5e..0000000000
--- a/bundled-war-example/src/main/resources/META-INF/persistence.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
- java:jboss/datasources/ExampleDS
- org.keycloak.models.jpa.entities.ApplicationEntity
- org.keycloak.models.jpa.entities.CredentialEntity
- org.keycloak.models.jpa.entities.OAuthClientEntity
- org.keycloak.models.jpa.entities.RealmEntity
- org.keycloak.models.jpa.entities.RequiredCredentialEntity
- org.keycloak.models.jpa.entities.AuthenticationProviderEntity
- org.keycloak.models.jpa.entities.ApplicationRoleEntity
- org.keycloak.models.jpa.entities.RealmRoleEntity
- org.keycloak.models.jpa.entities.SocialLinkEntity
- org.keycloak.models.jpa.entities.AuthenticationLinkEntity
- org.keycloak.models.jpa.entities.UserEntity
- org.keycloak.models.jpa.entities.UserSessionEntity
- org.keycloak.models.jpa.entities.UsernameLoginFailureEntity
- org.keycloak.models.jpa.entities.UserRoleMappingEntity
- org.keycloak.models.jpa.entities.ScopeMappingEntity
-
- true
-
-
-
-
-
-
-
- java:jboss/datasources/ExampleDS
- org.keycloak.audit.jpa.EventEntity
-
- true
-
-
-
-
-
-
-
diff --git a/bundled-war-example/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/bundled-war-example/src/main/webapp/WEB-INF/jboss-deployment-structure.xml
deleted file mode 100755
index 5457fd5b27..0000000000
--- a/bundled-war-example/src/main/webapp/WEB-INF/jboss-deployment-structure.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/bundled-war-example/src/main/webapp/WEB-INF/jboss-web.xml b/bundled-war-example/src/main/webapp/WEB-INF/jboss-web.xml
deleted file mode 100755
index 2f94ba4bca..0000000000
--- a/bundled-war-example/src/main/webapp/WEB-INF/jboss-web.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
- org.keycloak.adapters.as7.KeycloakAuthenticatorValve
-
-
\ No newline at end of file
diff --git a/bundled-war-example/src/main/webapp/WEB-INF/testrealm.json b/bundled-war-example/src/main/webapp/WEB-INF/testrealm.json
deleted file mode 100755
index 35ae9ad219..0000000000
--- a/bundled-war-example/src/main/webapp/WEB-INF/testrealm.json
+++ /dev/null
@@ -1,70 +0,0 @@
-{
- "realm": "demo",
- "enabled": true,
- "accessTokenLifespan": 3000,
- "accessCodeLifespan": 10,
- "accessCodeLifespanUserAction": 6000,
- "sslNotRequired": true,
- "registrationAllowed": false,
- "social": false,
- "updateProfileOnInitialSocialLogin": false,
- "requiredCredentials": [ "password" ],
- "users" : [
- {
- "username" : "bburke@redhat.com",
- "enabled": true,
- "email" : "bburke@redhat.com",
- "firstName": "Bill",
- "lastName": "Burke",
- "credentials" : [
- { "type" : "password",
- "value" : "password" }
- ]
- }
- ],
- "roles" : {
- "realm" : [
- {
- "name": "user",
- "description": "User privileges"
- },
- {
- "name": "admin",
- "description": "Administrator privileges"
- }
- ]
- },
- "roleMappings": [
- {
- "username": "bburke@redhat.com",
- "roles": ["user"]
- }
- ],
- "scopeMappings": [
- {
- "client": "customer-portal",
- "roles": ["user"]
- }
- ],
- "applications": [
- {
- "name": "customer-portal",
- "enabled": true,
- "adminUrl": "http://localhost:8080/app-bundle",
- "baseUrl": "http://localhost:8080/app-bundle",
- "redirectUris": [
- "http://localhost:8080/app-bundle/*"
- ],
- "secret": "password"
- }
- ],
- "applicationRoleMappings": {
- "account": [
- {
- "username": "bburke@redhat.com",
- "roles": ["manage-account"]
- }
- ]
- }
-
-}
diff --git a/bundled-war-example/src/main/webapp/WEB-INF/web.xml b/bundled-war-example/src/main/webapp/WEB-INF/web.xml
deleted file mode 100755
index 58fea700e8..0000000000
--- a/bundled-war-example/src/main/webapp/WEB-INF/web.xml
+++ /dev/null
@@ -1,130 +0,0 @@
-
-
-
- app-bundle
-
- host-port
- localhost:8080
-
-
-
- keycloak.import.realm.resources
- /WEB-INF/testrealm.json
-
-
-
- Keycloak REST Interface
- org.jboss.resteasy.plugins.server.servlet.HttpServlet30Dispatcher
-
- javax.ws.rs.Application
- org.keycloak.services.resources.KeycloakApplication
-
-
- resteasy.servlet.mapping.prefix
- /
-
- 1
- true
-
-
-
- Customer REST Interface
- org.jboss.resteasy.plugins.server.servlet.HttpServlet30Dispatcher
-
- javax.ws.rs.Application
- org.keycloak.example.oauth.DataApplication
-
-
- resteasy.servlet.mapping.prefix
- /database
-
- 2
- true
-
-
-
- org.keycloak.services.listeners.KeycloakSessionDestroyListener
-
-
-
- Keycloak Client Connection Filter
- org.keycloak.services.filters.ClientConnectionFilter
-
-
-
- Keycloak Session Management
- org.keycloak.services.filters.KeycloakSessionServletFilter
-
-
-
- Keycloak Session Management
- /*
-
-
-
- Keycloak Client Connection Filter
- /*
-
-
-
- Keycloak REST Interface
- /*
-
-
-
-
-
-
-
- index.html
-
-
-
- Customer REST Interface
- /database/*
-
-
-
-
- Customers
- /customers/*
-
-
- user
-
-
-
-
-
- Database
- /database/*
-
-
- user
-
-
-
-
- deny
- /customers/*
-
-
-
-
-
- BASIC
- demo
-
-
-
- admin
-
-
- user
-
-
-
-
diff --git a/bundled-war-example/src/main/webapp/customers/view.jsp b/bundled-war-example/src/main/webapp/customers/view.jsp
deleted file mode 100755
index 1ab0097c2e..0000000000
--- a/bundled-war-example/src/main/webapp/customers/view.jsp
+++ /dev/null
@@ -1,47 +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" %>
-<%@ page import="org.keycloak.representations.IDToken" %>
-
-
- Customer View Page
-
-
-<%
- String logoutUri = KeycloakUriBuilder.fromUri("http://localhost:8080/app-bundle/realms/demo/tokens/logout")
- .queryParam("redirect_uri", "http://localhost:8080/app-bundle").build().toString();
- String acctUri = "http://localhost:8080/app-bundle/realms/demo/account?referrer=customer-portal";
- IDToken idToken = CustomerDatabaseClient.getIDToken(request);
-%>
-logout | manage acct
-Servlet User Principal <%=request.getUserPrincipal().getName()%>
- made this request.
-Caller IDToken values (You can specify what is returned in IDToken in the customer-portal claims page in the admin console:
-Username: <%=idToken.getPreferredUsername()%>
-Email: <%=idToken.getEmail()%>
-Full Name: <%=idToken.getName()%>
-First: <%=idToken.getGivenName()%>
-Last: <%=idToken.getFamilyName()%>
-Customer Listing
-<%
- java.util.List list = null;
- try {
- list = CustomerDatabaseClient.getCustomers(request);
- } catch (CustomerDatabaseClient.Failure failure) {
- out.println("There was a failure processing request. You either didn't configure Keycloak properly, or maybe" +
- "you just forgot to secure the database service?");
- out.println("Status from database service invocation was: " + failure.getStatus());
- return;
- }
- for (String cust : list) {
- out.print("");
- out.print(cust);
- out.println("
");
-
- }
-%>
-
-
-
\ No newline at end of file
diff --git a/bundled-war-example/src/main/webapp/index.html b/bundled-war-example/src/main/webapp/index.html
deleted file mode 100755
index 681fa08a17..0000000000
--- a/bundled-war-example/src/main/webapp/index.html
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-Customer Portal
-
-Customer Listing
-
-
-
\ No newline at end of file
diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/js/controllers/realm.js b/forms/common-themes/src/main/resources/theme/admin/base/resources/js/controllers/realm.js
index 36992c6cdb..dd02ff28a0 100755
--- a/forms/common-themes/src/main/resources/theme/admin/base/resources/js/controllers/realm.js
+++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/js/controllers/realm.js
@@ -201,7 +201,7 @@ module.controller('RealmCreateCtrl', function($scope, Current, Realm, $upload, $
Realm.query(function(data) {
Current.realms = data;
- $http.get(authUrl + '/admin/whoami').success(function(user) {
+ WhoAmI.get(function(user) {
Auth.user = user;
$location.url("/realms/" + realmCopy.realm);
diff --git a/pom.xml b/pom.xml
index bc1e568b0b..335383bd42 100755
--- a/pom.xml
+++ b/pom.xml
@@ -100,7 +100,6 @@
testsuite
server
timer
- bundled-war-example
project-integrations
export-import
diff --git a/project-integrations/aerogear-ups/app/src/main/webapp/WEB-INF/web.xml b/project-integrations/aerogear-ups/app/src/main/webapp/WEB-INF/web.xml
index af91ffa36e..1be2b565ec 100755
--- a/project-integrations/aerogear-ups/app/src/main/webapp/WEB-INF/web.xml
+++ b/project-integrations/aerogear-ups/app/src/main/webapp/WEB-INF/web.xml
@@ -21,6 +21,16 @@
+
+
+ AdminConsole
+ /admin/*
+
+
+ admin
+
+
+
Database
diff --git a/project-integrations/aerogear-ups/app/src/main/webapp/admin/admin.html b/project-integrations/aerogear-ups/app/src/main/webapp/admin/admin.html
new file mode 100755
index 0000000000..8102dc0e3d
--- /dev/null
+++ b/project-integrations/aerogear-ups/app/src/main/webapp/admin/admin.html
@@ -0,0 +1 @@
+This would be the admin page for the UPS admin console.
\ No newline at end of file
diff --git a/project-integrations/aerogear-ups/auth-server/pom.xml b/project-integrations/aerogear-ups/auth-server/pom.xml
index 6ac1405b48..5dba72bb2d 100755
--- a/project-integrations/aerogear-ups/auth-server/pom.xml
+++ b/project-integrations/aerogear-ups/auth-server/pom.xml
@@ -135,6 +135,17 @@
keycloak-timer-basic
${project.version}
+
+ org.keycloak
+ keycloak-export-import-api
+ ${project.version}
+
+
+ org.keycloak
+ keycloak-export-import-impl
+ ${project.version}
+
+
org.jboss.spec.javax.servlet
diff --git a/project-integrations/aerogear-ups/auth-server/src/main/java/org/aerogear/ups/security/UpsSecurityApplication.java b/project-integrations/aerogear-ups/auth-server/src/main/java/org/aerogear/ups/security/UpsSecurityApplication.java
new file mode 100755
index 0000000000..eddeace54d
--- /dev/null
+++ b/project-integrations/aerogear-ups/auth-server/src/main/java/org/aerogear/ups/security/UpsSecurityApplication.java
@@ -0,0 +1,40 @@
+package org.aerogear.ups.security;
+
+import org.jboss.resteasy.core.Dispatcher;
+import org.keycloak.models.KeycloakSession;
+import org.keycloak.models.RealmModel;
+import org.keycloak.models.UserModel;
+import org.keycloak.services.managers.RealmManager;
+import org.keycloak.services.resources.KeycloakApplication;
+
+import javax.servlet.ServletContext;
+import javax.ws.rs.core.Context;
+
+/**
+ * @author Bill Burke
+ * @version $Revision: 1 $
+ */
+public class UpsSecurityApplication extends KeycloakApplication {
+ public UpsSecurityApplication(@Context ServletContext context, @Context Dispatcher dispatcher) {
+ super(context, dispatcher);
+ }
+
+ @Override
+ protected void setupDefaultRealm(String contextPath) {
+ super.setupDefaultRealm(contextPath);
+ KeycloakSession session = factory.createSession();
+ session.getTransaction().begin();
+
+ // disable master realm by deleting the admin user.
+ try {
+ RealmManager manager = new RealmManager(session);
+ RealmModel master = manager.getKeycloakAdminstrationRealm();
+ UserModel admin = master.getUser("admin");
+ if (admin != null) master.removeUser(admin.getLoginName());
+ session.getTransaction().commit();
+ } finally {
+ session.close();
+ }
+
+ }
+}
diff --git a/project-integrations/aerogear-ups/auth-server/src/main/webapp/WEB-INF/testrealm.json b/project-integrations/aerogear-ups/auth-server/src/main/webapp/WEB-INF/testrealm.json
index bc2d8f708a..bcbd7ad8eb 100755
--- a/project-integrations/aerogear-ups/auth-server/src/main/webapp/WEB-INF/testrealm.json
+++ b/project-integrations/aerogear-ups/auth-server/src/main/webapp/WEB-INF/testrealm.json
@@ -20,6 +20,19 @@
{ "type" : "password",
"value" : "password" }
]
+ },
+ {
+ "username" : "admin",
+ "enabled": true,
+ "firstName": "Bill",
+ "lastName": "Burke",
+ "credentials" : [
+ { "type" : "password",
+ "value" : "admin" }
+ ],
+ "requiredActions": [
+ "UPDATE_PASSWORD"
+ ]
}
],
"roles" : {
@@ -38,6 +51,10 @@
{
"username": "bburke@redhat.com",
"roles": ["user"]
+ },
+ {
+ "username": "admin",
+ "roles": ["user", "admin"]
}
],
"scopeMappings": [
@@ -64,6 +81,12 @@
"username": "bburke@redhat.com",
"roles": ["manage-account"]
}
+ ],
+ "demo-realm": [
+ {
+ "username": "admin",
+ "roles": ["realm-admin"]
+ }
]
}
diff --git a/project-integrations/aerogear-ups/auth-server/src/main/webapp/WEB-INF/web.xml b/project-integrations/aerogear-ups/auth-server/src/main/webapp/WEB-INF/web.xml
index 048c39d08c..bb58ec087b 100755
--- a/project-integrations/aerogear-ups/auth-server/src/main/webapp/WEB-INF/web.xml
+++ b/project-integrations/aerogear-ups/auth-server/src/main/webapp/WEB-INF/web.xml
@@ -16,7 +16,7 @@
org.jboss.resteasy.plugins.server.servlet.HttpServlet30Dispatcher
javax.ws.rs.Application
- org.keycloak.services.resources.KeycloakApplication
+ org.aerogear.ups.security.UpsSecurityApplication
resteasy.servlet.mapping.prefix