diff --git a/forms/common-themes/src/main/java/org/keycloak/theme/ClassLoaderTheme.java b/forms/common-themes/src/main/java/org/keycloak/theme/ClassLoaderTheme.java old mode 100644 new mode 100755 index 5a41cf70a6..1a793eee7c --- a/forms/common-themes/src/main/java/org/keycloak/theme/ClassLoaderTheme.java +++ b/forms/common-themes/src/main/java/org/keycloak/theme/ClassLoaderTheme.java @@ -12,25 +12,29 @@ import java.util.Properties; */ public class ClassLoaderTheme implements Theme { - private final String name; + private String name; - private final String parentName; + private String parentName; - private final String importName; + private String importName; - private final Type type; + private Type type; - private final ClassLoader classLoader; + private ClassLoader classLoader; - private final String templateRoot; + private String templateRoot; - private final String resourceRoot; + private String resourceRoot; - private final String messages; + private String messages; - private final Properties properties; + private Properties properties; public ClassLoaderTheme(String name, Type type, ClassLoader classLoader) throws IOException { + init(name, type, classLoader); + } + + public void init(String name, Type type, ClassLoader classLoader) throws IOException { this.name = name; this.type = type; this.classLoader = classLoader; @@ -53,6 +57,10 @@ public class ClassLoaderTheme implements Theme { } } + public ClassLoaderTheme() { + + } + @Override public String getName() { return name; diff --git a/forms/common-themes/src/main/resources/theme/admin/keycloak/resources/css/styles.css b/forms/common-themes/src/main/resources/theme/admin/keycloak/resources/css/styles.css old mode 100644 new mode 100755 index d5ca9aafe9..e71ad3db1a --- a/forms/common-themes/src/main/resources/theme/admin/keycloak/resources/css/styles.css +++ b/forms/common-themes/src/main/resources/theme/admin/keycloak/resources/css/styles.css @@ -31,4 +31,5 @@ border-bottom: none; border-right-color: rgba(255,255,255,0.15); border-top-color: rgba(255,255,255,0.05); -} \ No newline at end of file +} + diff --git a/project-integrations/aerogear-ups/app/pom.xml b/project-integrations/aerogear-ups/app/pom.xml index 31239638ae..9508f274f1 100755 --- a/project-integrations/aerogear-ups/app/pom.xml +++ b/project-integrations/aerogear-ups/app/pom.xml @@ -85,7 +85,7 @@ - app + aerogear-ups org.jboss.as.plugins diff --git a/project-integrations/aerogear-ups/app/src/main/java/org/keycloak/example/BootstrapListener.java b/project-integrations/aerogear-ups/app/src/main/java/org/keycloak/example/BootstrapListener.java index 23c632abe3..248785173e 100755 --- a/project-integrations/aerogear-ups/app/src/main/java/org/keycloak/example/BootstrapListener.java +++ b/project-integrations/aerogear-ups/app/src/main/java/org/keycloak/example/BootstrapListener.java @@ -15,8 +15,8 @@ public class BootstrapListener implements ServletContextListener { public void contextInitialized(ServletContextEvent sce) { AdapterDeploymentContext deploymentContext = (AdapterDeploymentContext)sce.getServletContext().getAttribute(AdapterDeploymentContext.class.getName()); AdapterConfig config = new AdapterConfig(); - config.setRealm("demo"); - config.setResource("customer-portal"); + config.setRealm("aerogear"); + config.setResource("unified-push-server"); config.setAuthServerUrl("/auth"); config.setSslNotRequired(true); config.setPublicClient(true); 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 1be2b565ec..23e283196c 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 @@ -4,7 +4,7 @@ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> - app + aerogear-ups org.keycloak.example.BootstrapListener @@ -13,28 +13,8 @@ - Customers - /customers/* - - - user - - - - - - AdminConsole - /admin/* - - - admin - - - - - - Database - /rest/* + UPS + /ups/* user @@ -46,7 +26,22 @@ --> - + + + AdminConsole + /admin/* + + + admin + + + + + BASIC demo diff --git a/project-integrations/aerogear-ups/app/src/main/webapp/index.html b/project-integrations/aerogear-ups/app/src/main/webapp/index.html index 681fa08a17..83a804267a 100755 --- a/project-integrations/aerogear-ups/app/src/main/webapp/index.html +++ b/project-integrations/aerogear-ups/app/src/main/webapp/index.html @@ -5,9 +5,9 @@ -

Customer Portal

+

Aerogear UPS Portal

-

Customer Listing

+

Play with Aerogear UPS

\ No newline at end of file diff --git a/project-integrations/aerogear-ups/app/src/main/webapp/customers/view.jsp b/project-integrations/aerogear-ups/app/src/main/webapp/ups/view.jsp similarity index 81% rename from project-integrations/aerogear-ups/app/src/main/webapp/customers/view.jsp rename to project-integrations/aerogear-ups/app/src/main/webapp/ups/view.jsp index 5e0cc9f308..ae21dbc3cc 100755 --- a/project-integrations/aerogear-ups/app/src/main/webapp/customers/view.jsp +++ b/project-integrations/aerogear-ups/app/src/main/webapp/ups/view.jsp @@ -2,7 +2,7 @@ pageEncoding="ISO-8859-1" %> - Customer View Page + Aerogear - UPS View Page diff --git a/project-integrations/aerogear-ups/auth-server/src/main/java/org/aerogear/ups/security/AerogearThemeProvider.java b/project-integrations/aerogear-ups/auth-server/src/main/java/org/aerogear/ups/security/AerogearThemeProvider.java new file mode 100755 index 0000000000..d8ef5e0906 --- /dev/null +++ b/project-integrations/aerogear-ups/auth-server/src/main/java/org/aerogear/ups/security/AerogearThemeProvider.java @@ -0,0 +1,62 @@ +package org.aerogear.ups.security; + +import org.keycloak.freemarker.Theme; +import org.keycloak.freemarker.ThemeProvider; +import org.keycloak.theme.ClassLoaderTheme; + +import java.io.IOException; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; + +/** + * @author Stian Thorgersen + */ +public class AerogearThemeProvider implements ThemeProvider { + + public static final String AEROGEAR = "aerogear"; + + private static Set ACCOUNT_THEMES = new HashSet(); + private static Set LOGIN_THEMES = new HashSet(); + private static Set ADMIN_THEMES = new HashSet(); + + static { + Collections.addAll(ACCOUNT_THEMES, AEROGEAR); + Collections.addAll(LOGIN_THEMES, AEROGEAR); + Collections.addAll(ADMIN_THEMES, AEROGEAR); + } + + @Override + public int getProviderPriority() { + return 0; + } + + @Override + public Theme createTheme(String name, Theme.Type type) throws IOException { + if (hasTheme(name, type)) { + return new ClassLoaderTheme(name, type, getClass().getClassLoader()); + } else { + return null; + } + } + + @Override + public Set nameSet(Theme.Type type) { + switch (type) { + case LOGIN: + return LOGIN_THEMES; + case ACCOUNT: + return ACCOUNT_THEMES; + case ADMIN: + return ADMIN_THEMES; + default: + return Collections.emptySet(); + } + } + + @Override + public boolean hasTheme(String name, Theme.Type type) { + return nameSet(type).contains(name); + } + +} diff --git a/project-integrations/aerogear-ups/auth-server/src/main/resources/META-INF/services/org.keycloak.freemarker.ThemeProvider b/project-integrations/aerogear-ups/auth-server/src/main/resources/META-INF/services/org.keycloak.freemarker.ThemeProvider new file mode 100755 index 0000000000..89dd8749b0 --- /dev/null +++ b/project-integrations/aerogear-ups/auth-server/src/main/resources/META-INF/services/org.keycloak.freemarker.ThemeProvider @@ -0,0 +1 @@ +org.aerogear.ups.security.AerogearThemeProvider \ No newline at end of file diff --git a/project-integrations/aerogear-ups/auth-server/src/main/resources/theme/account/aerogear/resources/css/account.css b/project-integrations/aerogear-ups/auth-server/src/main/resources/theme/account/aerogear/resources/css/account.css new file mode 100755 index 0000000000..28b20bbb38 --- /dev/null +++ b/project-integrations/aerogear-ups/auth-server/src/main/resources/theme/account/aerogear/resources/css/account.css @@ -0,0 +1,8 @@ +.navbar-title { + background-image: url('../img/logo.png'); + height: 65px; + background-repeat: no-repeat; + width: 203px; + margin: 3px 10px 5px; + text-indent: -99999px; +} \ No newline at end of file diff --git a/project-integrations/aerogear-ups/auth-server/src/main/resources/theme/account/aerogear/resources/img/logo.png b/project-integrations/aerogear-ups/auth-server/src/main/resources/theme/account/aerogear/resources/img/logo.png new file mode 100755 index 0000000000..d55812da24 Binary files /dev/null and b/project-integrations/aerogear-ups/auth-server/src/main/resources/theme/account/aerogear/resources/img/logo.png differ diff --git a/project-integrations/aerogear-ups/auth-server/src/main/resources/theme/account/aerogear/theme.properties b/project-integrations/aerogear-ups/auth-server/src/main/resources/theme/account/aerogear/theme.properties new file mode 100755 index 0000000000..04feb70eda --- /dev/null +++ b/project-integrations/aerogear-ups/auth-server/src/main/resources/theme/account/aerogear/theme.properties @@ -0,0 +1,4 @@ +parent=keycloak +import=common/keycloak + +styles= ../patternfly/lib/patternfly/css/patternfly.css ../patternfly/css/account.css ../keycloak/css/account.css css/account.css \ No newline at end of file diff --git a/project-integrations/aerogear-ups/auth-server/src/main/resources/theme/admin/aerogear/resources/css/styles.css b/project-integrations/aerogear-ups/auth-server/src/main/resources/theme/admin/aerogear/resources/css/styles.css new file mode 100755 index 0000000000..84300fe265 --- /dev/null +++ b/project-integrations/aerogear-ups/auth-server/src/main/resources/theme/admin/aerogear/resources/css/styles.css @@ -0,0 +1,45 @@ +@import url("../lib/patternfly/css/patternfly.css"); +@import url("../lib/select2-3.4.1/select2.css"); + +@import url("admin-console.css"); +@import url("tables.css"); +@import url("sprites.css"); + +.navbar-pf { + background-image: url('../img/header-bkgrnd.png'); + border-top: 3px solid rgba(255, 255, 255, 0.15); +} + +.navbar-pf .navbar-primary { + font-size: 13px; + background-image: -webkit-linear-gradient(top, rgba(0,0,0,0.1) 0%, rgba(0,0,0,.4) 100%); + background-image: linear-gradient(to bottom, rgba(0,0,0,.1) 0%, rgba(0,0,0,.4) 100%); +} + +.navbar-pf .navbar-header { + border-bottom: 1px solid rgba(255,255,255,.15); +} + +.navbar-pf .navbar-primary li.dropdown.context > a, +.navbar-pf .navbar-primary li.dropdown.context > a:hover, +.navbar-pf .navbar-primary li.dropdown.context.open > a, +.navbar-pf .navbar-primary > .active > a, +.navbar-pf .navbar-primary > .active > a:hover{ + background-color: rgba(0,0,0,0.1); + background-image: -webkit-linear-gradient(top, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.1) 100%); + background-image: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.1) 100%); + border-bottom: none; + border-right-color: rgba(255,255,255,0.15); + border-top-color: rgba(255,255,255,0.05); +} + +/* this is what I added */ + +.navbar-title { + background-image: url('../img/logo.png'); + height: 65px; + background-repeat: no-repeat; + width: 203px; + margin: 3px 10px 5px; + text-indent: -99999px; +} diff --git a/project-integrations/aerogear-ups/auth-server/src/main/resources/theme/admin/aerogear/resources/img/logo.png b/project-integrations/aerogear-ups/auth-server/src/main/resources/theme/admin/aerogear/resources/img/logo.png new file mode 100755 index 0000000000..d55812da24 Binary files /dev/null and b/project-integrations/aerogear-ups/auth-server/src/main/resources/theme/admin/aerogear/resources/img/logo.png differ diff --git a/project-integrations/aerogear-ups/auth-server/src/main/resources/theme/admin/aerogear/theme.properties b/project-integrations/aerogear-ups/auth-server/src/main/resources/theme/admin/aerogear/theme.properties new file mode 100755 index 0000000000..e328b3f5c6 --- /dev/null +++ b/project-integrations/aerogear-ups/auth-server/src/main/resources/theme/admin/aerogear/theme.properties @@ -0,0 +1,4 @@ +parent=keycloak +import=common/keycloak + +styles= ../keycloak/css/styles.css css/styles.css \ No newline at end of file diff --git a/project-integrations/aerogear-ups/auth-server/src/main/resources/theme/login/aerogear/resources/css/login.css b/project-integrations/aerogear-ups/auth-server/src/main/resources/theme/login/aerogear/resources/css/login.css new file mode 100755 index 0000000000..3b9207c170 --- /dev/null +++ b/project-integrations/aerogear-ups/auth-server/src/main/resources/theme/login/aerogear/resources/css/login.css @@ -0,0 +1,9 @@ +#kc-logo-wrapper { + background-image: url("../img/logo.png"); + background-repeat: no-repeat; + background-position: top right; + + height: 65px; + + margin: 100px; +} diff --git a/project-integrations/aerogear-ups/auth-server/src/main/resources/theme/login/aerogear/resources/img/logo.png b/project-integrations/aerogear-ups/auth-server/src/main/resources/theme/login/aerogear/resources/img/logo.png new file mode 100755 index 0000000000..d55812da24 Binary files /dev/null and b/project-integrations/aerogear-ups/auth-server/src/main/resources/theme/login/aerogear/resources/img/logo.png differ diff --git a/project-integrations/aerogear-ups/auth-server/src/main/resources/theme/login/aerogear/theme.properties b/project-integrations/aerogear-ups/auth-server/src/main/resources/theme/login/aerogear/theme.properties new file mode 100755 index 0000000000..d1b98ed842 --- /dev/null +++ b/project-integrations/aerogear-ups/auth-server/src/main/resources/theme/login/aerogear/theme.properties @@ -0,0 +1,4 @@ +parent=keycloak +import=common/keycloak + +styles= ../patternfly/lib/patternfly/css/patternfly.css ../patternfly/css/login.css ../patternfly/lib/zocial/zocial.css ../keycloak/css/login.css css/login.css \ No newline at end of file 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 bcbd7ad8eb..26afcf9713 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 @@ -1,5 +1,5 @@ { - "realm": "demo", + "realm": "aerogear", "enabled": true, "accessTokenLifespan": 3000, "accessCodeLifespan": 10, @@ -7,6 +7,9 @@ "sslNotRequired": true, "registrationAllowed": false, "social": false, + "adminTheme": "aerogear", + "accountTheme": "aerogear", + "loginTheme": "aerogear", "updateProfileOnInitialSocialLogin": false, "requiredCredentials": [ "password" ], "users" : [ @@ -24,7 +27,7 @@ { "username" : "admin", "enabled": true, - "firstName": "Bill", + "firstName": "Meister", "lastName": "Burke", "credentials" : [ { "type" : "password", @@ -59,19 +62,19 @@ ], "scopeMappings": [ { - "client": "customer-portal", - "roles": ["user"] + "client": "unified-push-server", + "roles": ["user", "admin"] } ], "applications": [ { - "name": "customer-portal", + "name": "unified-push-server", "enabled": true, "publicClient": true, - "adminUrl": "/app", - "baseUrl": "/app", + "adminUrl": "/aerogear-ups", + "baseUrl": "/aerogear-ups", "redirectUris": [ - "/app/*" + "/aerogear-ups/*" ] } ], @@ -80,9 +83,13 @@ { "username": "bburke@redhat.com", "roles": ["manage-account"] + }, + { + "username": "admin", + "roles": ["manage-account"] } ], - "demo-realm": [ + "aerogear-realm": [ { "username": "admin", "roles": ["realm-admin"]