diff --git a/core/src/main/java/org/keycloak/representations/config/AdapterConfig.java b/core/src/main/java/org/keycloak/representations/config/AdapterConfig.java
new file mode 100755
index 0000000000..56381d7d29
--- /dev/null
+++ b/core/src/main/java/org/keycloak/representations/config/AdapterConfig.java
@@ -0,0 +1,107 @@
+package org.keycloak.representations.config;
+
+import org.codehaus.jackson.annotate.JsonProperty;
+import org.codehaus.jackson.annotate.JsonPropertyOrder;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Configuration for Java based adapters
+ *
+ * @author Bill Burke
+ * @version $Revision: 1 $
+ */
+@JsonPropertyOrder({"realm", "realm-public-key", "auth-url", "code-url", "ssl-not-required",
+ "resource", "credentials",
+ "use-resource-role-mappings",
+ "enable-cors", "cors-max-age", "cors-allowed-methods",
+ "expose-token", "bearer-only",
+ "connection-pool-size",
+ "allow-any-hostname", "disable-trust-manager", "truststore", "truststore-password",
+ "client-keystore", "client-keystore-password", "client-key-password"
+})
+public class AdapterConfig extends BaseAdapterConfig {
+
+ @JsonProperty("allow-any-hostname")
+ protected boolean allowAnyHostname;
+ @JsonProperty("disable-trust-manager")
+ protected boolean disableTrustManager;
+ @JsonProperty("truststore")
+ protected String truststore;
+ @JsonProperty("truststore-password")
+ protected String truststorePassword;
+ @JsonProperty("client-keystore")
+ protected String clientKeystore;
+ @JsonProperty("client-keystore-password")
+ protected String clientKeystorePassword;
+ @JsonProperty("client-key-password")
+ protected String clientKeyPassword;
+ @JsonProperty("connection-pool-size")
+ protected int connectionPoolSize = 20;
+
+ public boolean isAllowAnyHostname() {
+ return allowAnyHostname;
+ }
+
+ public void setAllowAnyHostname(boolean allowAnyHostname) {
+ this.allowAnyHostname = allowAnyHostname;
+ }
+
+ public boolean isDisableTrustManager() {
+ return disableTrustManager;
+ }
+
+ public void setDisableTrustManager(boolean disableTrustManager) {
+ this.disableTrustManager = disableTrustManager;
+ }
+
+ public String getTruststore() {
+ return truststore;
+ }
+
+ public void setTruststore(String truststore) {
+ this.truststore = truststore;
+ }
+
+ public String getTruststorePassword() {
+ return truststorePassword;
+ }
+
+ public void setTruststorePassword(String truststorePassword) {
+ this.truststorePassword = truststorePassword;
+ }
+
+ public String getClientKeystore() {
+ return clientKeystore;
+ }
+
+ public void setClientKeystore(String clientKeystore) {
+ this.clientKeystore = clientKeystore;
+ }
+
+ public String getClientKeystorePassword() {
+ return clientKeystorePassword;
+ }
+
+ public void setClientKeystorePassword(String clientKeystorePassword) {
+ this.clientKeystorePassword = clientKeystorePassword;
+ }
+
+ public String getClientKeyPassword() {
+ return clientKeyPassword;
+ }
+
+ public void setClientKeyPassword(String clientKeyPassword) {
+ this.clientKeyPassword = clientKeyPassword;
+ }
+
+ public int getConnectionPoolSize() {
+ return connectionPoolSize;
+ }
+
+ public void setConnectionPoolSize(int connectionPoolSize) {
+ this.connectionPoolSize = connectionPoolSize;
+ }
+
+}
diff --git a/core/src/main/java/org/keycloak/representations/config/BaseAdapterConfig.java b/core/src/main/java/org/keycloak/representations/config/BaseAdapterConfig.java
new file mode 100755
index 0000000000..a0f7cdfd10
--- /dev/null
+++ b/core/src/main/java/org/keycloak/representations/config/BaseAdapterConfig.java
@@ -0,0 +1,111 @@
+package org.keycloak.representations.config;
+
+import org.codehaus.jackson.annotate.JsonProperty;
+import org.codehaus.jackson.annotate.JsonPropertyOrder;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Common Adapter configuration
+ *
+ * @author Bill Burke
+ * @version $Revision: 1 $
+ */
+@JsonPropertyOrder({"realm", "realm-public-key", "auth-url", "code-url", "ssl-not-required",
+ "resource", "credentials",
+ "use-resource-role-mappings",
+ "enable-cors", "cors-max-age", "cors-allowed-methods",
+ "expose-token", "bearer-only"})
+public class BaseAdapterConfig extends BaseRealmConfig {
+ @JsonProperty("resource")
+ protected String resource;
+ @JsonProperty("use-resource-role-mappings")
+ protected boolean useResourceRoleMappings;
+ @JsonProperty("enable-cors")
+ protected boolean cors;
+ @JsonProperty("cors-max-age")
+ protected int corsMaxAge = -1;
+ @JsonProperty("cors-allowed-headers")
+ protected String corsAllowedHeaders;
+ @JsonProperty("cors-allowed-methods")
+ protected String corsAllowedMethods;
+ @JsonProperty("expose-token")
+ protected boolean exposeToken;
+ @JsonProperty("bearer-only")
+ protected boolean bearerOnly;
+ @JsonProperty("credentials")
+ protected Map credentials = new HashMap();
+
+ public boolean isUseResourceRoleMappings() {
+ return useResourceRoleMappings;
+ }
+
+ public void setUseResourceRoleMappings(boolean useResourceRoleMappings) {
+ this.useResourceRoleMappings = useResourceRoleMappings;
+ }
+
+ public String getResource() {
+ return resource;
+ }
+
+ public void setResource(String resource) {
+ this.resource = resource;
+ }
+
+ public boolean isCors() {
+ return cors;
+ }
+
+ public void setCors(boolean cors) {
+ this.cors = cors;
+ }
+
+ public int getCorsMaxAge() {
+ return corsMaxAge;
+ }
+
+ public void setCorsMaxAge(int corsMaxAge) {
+ this.corsMaxAge = corsMaxAge;
+ }
+
+ public String getCorsAllowedHeaders() {
+ return corsAllowedHeaders;
+ }
+
+ public void setCorsAllowedHeaders(String corsAllowedHeaders) {
+ this.corsAllowedHeaders = corsAllowedHeaders;
+ }
+
+ public String getCorsAllowedMethods() {
+ return corsAllowedMethods;
+ }
+
+ public void setCorsAllowedMethods(String corsAllowedMethods) {
+ this.corsAllowedMethods = corsAllowedMethods;
+ }
+
+ public boolean isExposeToken() {
+ return exposeToken;
+ }
+
+ public void setExposeToken(boolean exposeToken) {
+ this.exposeToken = exposeToken;
+ }
+
+ public boolean isBearerOnly() {
+ return bearerOnly;
+ }
+
+ public void setBearerOnly(boolean bearerOnly) {
+ this.bearerOnly = bearerOnly;
+ }
+
+ public Map getCredentials() {
+ return credentials;
+ }
+
+ public void setCredentials(Map credentials) {
+ this.credentials = credentials;
+ }
+}
diff --git a/core/src/main/java/org/keycloak/representations/idm/ApplicationInstallationRepresentation.java b/core/src/main/java/org/keycloak/representations/config/BaseRealmConfig.java
similarity index 53%
rename from core/src/main/java/org/keycloak/representations/idm/ApplicationInstallationRepresentation.java
rename to core/src/main/java/org/keycloak/representations/config/BaseRealmConfig.java
index 23f9516482..eefde69bf3 100755
--- a/core/src/main/java/org/keycloak/representations/idm/ApplicationInstallationRepresentation.java
+++ b/core/src/main/java/org/keycloak/representations/config/BaseRealmConfig.java
@@ -1,78 +1,64 @@
-package org.keycloak.representations.idm;
-
-import org.codehaus.jackson.annotate.JsonProperty;
-
-import java.util.Map;
-
-/**
- * @author Stian Thorgersen
- */
-public class ApplicationInstallationRepresentation {
- protected String realm;
- protected String resource;
- @JsonProperty("realm-public-key")
- protected String realmPublicKey;
- @JsonProperty("auth-url")
- protected String authUrl;
- @JsonProperty("code-url")
- protected String codeUrl;
- @JsonProperty("ssl-not-required")
- protected boolean sslNotRequired;
- protected Map credentials;
-
- public String getRealm() {
- return realm;
- }
-
- public void setRealm(String realm) {
- this.realm = realm;
- }
-
- public String getResource() {
- return resource;
- }
-
- public void setResource(String resource) {
- this.resource = resource;
- }
-
- public String getRealmPublicKey() {
- return realmPublicKey;
- }
-
- public void setRealmPublicKey(String realmPublicKey) {
- this.realmPublicKey = realmPublicKey;
- }
-
- public String getAuthUrl() {
- return authUrl;
- }
-
- public void setAuthUrl(String authUrl) {
- this.authUrl = authUrl;
- }
-
- public String getCodeUrl() {
- return codeUrl;
- }
-
- public void setCodeUrl(String codeUrl) {
- this.codeUrl = codeUrl;
- }
-
- public boolean isSslNotRequired() {
- return sslNotRequired;
- }
-
- public void setSslNotRequired(boolean sslNotRequired) {
- this.sslNotRequired = sslNotRequired;
- }
-
- public Map getCredentials() {
- return credentials;
- }
-
- public void setCredentials(Map credentials) {
- this.credentials = credentials;
- }
-}
+package org.keycloak.representations.config;
+
+import org.codehaus.jackson.annotate.JsonProperty;
+import org.codehaus.jackson.annotate.JsonPropertyOrder;
+
+/**
+ * Common Realm Configuration
+ *
+ * @author Bill Burke
+ * @version $Revision: 1 $
+ */
+@JsonPropertyOrder({"realm", "realm-public-key", "auth-url", "code-url", "ssl-not-required"})
+public class BaseRealmConfig {
+ @JsonProperty("realm")
+ protected String realm;
+ @JsonProperty("realm-public-key")
+ protected String realmKey;
+ @JsonProperty("auth-url")
+ protected String authUrl;
+ @JsonProperty("code-url")
+ protected String codeUrl;
+ @JsonProperty("ssl-not-required")
+ protected boolean sslNotRequired;
+
+ public boolean isSslNotRequired() {
+ return sslNotRequired;
+ }
+
+ public void setSslNotRequired(boolean sslNotRequired) {
+ this.sslNotRequired = sslNotRequired;
+ }
+
+ public String getRealm() {
+ return realm;
+ }
+
+ public void setRealm(String realm) {
+ this.realm = realm;
+ }
+
+ public String getRealmKey() {
+ return realmKey;
+ }
+
+ public void setRealmKey(String realmKey) {
+ this.realmKey = realmKey;
+ }
+
+ public String getAuthUrl() {
+ return authUrl;
+ }
+
+ public void setAuthUrl(String authUrl) {
+ this.authUrl = authUrl;
+ }
+
+ public String getCodeUrl() {
+ return codeUrl;
+ }
+
+ public void setCodeUrl(String codeUrl) {
+ this.codeUrl = codeUrl;
+ }
+}
diff --git a/core/src/main/java/org/keycloak/util/JsonSerialization.java b/core/src/main/java/org/keycloak/util/JsonSerialization.java
index 4b573e2a58..3eb2d35c72 100755
--- a/core/src/main/java/org/keycloak/util/JsonSerialization.java
+++ b/core/src/main/java/org/keycloak/util/JsonSerialization.java
@@ -1,6 +1,7 @@
package org.keycloak.util;
import org.codehaus.jackson.map.ObjectMapper;
+import org.codehaus.jackson.map.SerializationConfig;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import java.io.IOException;
@@ -14,10 +15,14 @@ import java.io.InputStream;
*/
public class JsonSerialization {
public static final ObjectMapper mapper = new ObjectMapper();
+ public static final ObjectMapper prettyMapper = new ObjectMapper();
static {
mapper.setSerializationInclusion(JsonSerialize.Inclusion.NON_DEFAULT);
mapper.setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
+ prettyMapper.enable(SerializationConfig.Feature.INDENT_OUTPUT);
+ prettyMapper.setSerializationInclusion(JsonSerialize.Inclusion.NON_DEFAULT);
+ prettyMapper.setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
}
public static String writeValueAsString(Object obj) throws IOException {
diff --git a/integration/adapter-core/src/main/java/org/keycloak/adapters/config/AdapterConfig.java b/integration/adapter-core/src/main/java/org/keycloak/adapters/config/AdapterConfig.java
deleted file mode 100755
index 5bdaf5b327..0000000000
--- a/integration/adapter-core/src/main/java/org/keycloak/adapters/config/AdapterConfig.java
+++ /dev/null
@@ -1,243 +0,0 @@
-package org.keycloak.adapters.config;
-
-import org.codehaus.jackson.annotate.JsonProperty;
-import org.codehaus.jackson.annotate.JsonPropertyOrder;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author Bill Burke
- * @version $Revision: 1 $
- */
-@JsonPropertyOrder({"realm-url", "realm", "resource", "realm-public-key", "admin-role", "auth-url", "code-url", "allow-any-hostname", "disable-trust-manager", "truststore", "truststore-password", "client-id", "client-credentials"})
-public class AdapterConfig
-{
- @JsonProperty("realm-url")
- protected String realmUrl;
- @JsonProperty("realm")
- protected String realm;
- @JsonProperty("resource")
- protected String resource;
- @JsonProperty("realm-public-key")
- protected String realmKey;
- @JsonProperty("auth-url")
- protected String authUrl;
- @JsonProperty("code-url")
- protected String codeUrl;
- @JsonProperty("use-resource-role-mappings")
- protected boolean useResourceRoleMappings;
-
- @JsonProperty("ssl-not-required")
- protected boolean sslNotRequired;
- @JsonProperty("allow-any-hostname")
- protected boolean allowAnyHostname;
- @JsonProperty("disable-trust-manager")
- protected boolean disableTrustManager;
- @JsonProperty("truststore")
- protected String truststore;
- @JsonProperty("truststore-password")
- protected String truststorePassword;
- @JsonProperty("client-keystore")
- protected String clientKeystore;
- @JsonProperty("client-keystore-password")
- protected String clientKeystorePassword;
- @JsonProperty("client-key-password")
- protected String clientKeyPassword;
- @JsonProperty("credentials")
- protected Map credentials = new HashMap();
- @JsonProperty("connection-pool-size")
- protected int connectionPoolSize;
- @JsonProperty("enable-cors")
- protected boolean cors;
- @JsonProperty("cors-max-age")
- protected int corsMaxAge = -1;
- @JsonProperty("cors-allowed-headers")
- protected String corsAllowedHeaders;
- @JsonProperty("cors-allowed-methods")
- protected String corsAllowedMethods;
- @JsonProperty("expose-token")
- protected boolean exposeToken;
- @JsonProperty("bearer-only")
- protected boolean bearerOnly;
-
- public boolean isUseResourceRoleMappings() {
- return useResourceRoleMappings;
- }
-
- public void setUseResourceRoleMappings(boolean useResourceRoleMappings) {
- this.useResourceRoleMappings = useResourceRoleMappings;
- }
-
- public boolean isSslNotRequired() {
- return sslNotRequired;
- }
-
- public void setSslNotRequired(boolean sslNotRequired) {
- this.sslNotRequired = sslNotRequired;
- }
-
- public String getRealmUrl() {
- return realmUrl;
- }
-
- public void setRealmUrl(String realmUrl) {
- this.realmUrl = realmUrl;
- }
-
- public String getRealm() {
- return realm;
- }
-
- public void setRealm(String realm) {
- this.realm = realm;
- }
-
- public String getResource() {
- return resource;
- }
-
- public void setResource(String resource) {
- this.resource = resource;
- }
-
- public String getRealmKey() {
- return realmKey;
- }
-
- public void setRealmKey(String realmKey) {
- this.realmKey = realmKey;
- }
-
- public String getAuthUrl() {
- return authUrl;
- }
-
- public void setAuthUrl(String authUrl) {
- this.authUrl = authUrl;
- }
-
- public String getCodeUrl() {
- return codeUrl;
- }
-
- public void setCodeUrl(String codeUrl) {
- this.codeUrl = codeUrl;
- }
-
- public boolean isAllowAnyHostname() {
- return allowAnyHostname;
- }
-
- public void setAllowAnyHostname(boolean allowAnyHostname) {
- this.allowAnyHostname = allowAnyHostname;
- }
-
- public boolean isDisableTrustManager() {
- return disableTrustManager;
- }
-
- public void setDisableTrustManager(boolean disableTrustManager) {
- this.disableTrustManager = disableTrustManager;
- }
-
- public String getTruststore() {
- return truststore;
- }
-
- public void setTruststore(String truststore) {
- this.truststore = truststore;
- }
-
- public String getTruststorePassword() {
- return truststorePassword;
- }
-
- public void setTruststorePassword(String truststorePassword) {
- this.truststorePassword = truststorePassword;
- }
-
- public Map getCredentials() {
- return credentials;
- }
-
- public String getClientKeystore() {
- return clientKeystore;
- }
-
- public void setClientKeystore(String clientKeystore) {
- this.clientKeystore = clientKeystore;
- }
-
- public String getClientKeystorePassword() {
- return clientKeystorePassword;
- }
-
- public void setClientKeystorePassword(String clientKeystorePassword) {
- this.clientKeystorePassword = clientKeystorePassword;
- }
-
- public String getClientKeyPassword() {
- return clientKeyPassword;
- }
-
- public void setClientKeyPassword(String clientKeyPassword) {
- this.clientKeyPassword = clientKeyPassword;
- }
-
- public int getConnectionPoolSize() {
- return connectionPoolSize;
- }
-
- public void setConnectionPoolSize(int connectionPoolSize) {
- this.connectionPoolSize = connectionPoolSize;
- }
-
- public boolean isCors() {
- return cors;
- }
-
- public void setCors(boolean cors) {
- this.cors = cors;
- }
-
- public int getCorsMaxAge() {
- return corsMaxAge;
- }
-
- public void setCorsMaxAge(int corsMaxAge) {
- this.corsMaxAge = corsMaxAge;
- }
-
- public String getCorsAllowedHeaders() {
- return corsAllowedHeaders;
- }
-
- public void setCorsAllowedHeaders(String corsAllowedHeaders) {
- this.corsAllowedHeaders = corsAllowedHeaders;
- }
-
- public String getCorsAllowedMethods() {
- return corsAllowedMethods;
- }
-
- public void setCorsAllowedMethods(String corsAllowedMethods) {
- this.corsAllowedMethods = corsAllowedMethods;
- }
-
- public boolean isExposeToken() {
- return exposeToken;
- }
-
- public void setExposeToken(boolean exposeToken) {
- this.exposeToken = exposeToken;
- }
-
- public boolean isBearerOnly() {
- return bearerOnly;
- }
-
- public void setBearerOnly(boolean bearerOnly) {
- this.bearerOnly = bearerOnly;
- }
-}
diff --git a/integration/adapter-core/src/main/java/org/keycloak/adapters/config/AdapterConfigLoader.java b/integration/adapter-core/src/main/java/org/keycloak/adapters/config/AdapterConfigLoader.java
index 86590a2a62..b0db3dc5d4 100755
--- a/integration/adapter-core/src/main/java/org/keycloak/adapters/config/AdapterConfigLoader.java
+++ b/integration/adapter-core/src/main/java/org/keycloak/adapters/config/AdapterConfigLoader.java
@@ -5,6 +5,7 @@ import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.keycloak.EnvUtil;
import org.keycloak.PemUtils;
import org.keycloak.ResourceMetadata;
+import org.keycloak.representations.config.AdapterConfig;
import java.io.File;
import java.io.FileInputStream;
diff --git a/integration/as7-eap6/adapter/src/main/java/org/keycloak/adapters/as7/AuthenticatedActionsValve.java b/integration/as7-eap6/adapter/src/main/java/org/keycloak/adapters/as7/AuthenticatedActionsValve.java
index 5738b3d0b0..823b703d1d 100755
--- a/integration/as7-eap6/adapter/src/main/java/org/keycloak/adapters/as7/AuthenticatedActionsValve.java
+++ b/integration/as7-eap6/adapter/src/main/java/org/keycloak/adapters/as7/AuthenticatedActionsValve.java
@@ -8,7 +8,7 @@ import org.apache.catalina.connector.Response;
import org.apache.catalina.valves.ValveBase;
import org.jboss.logging.Logger;
import org.keycloak.SkeletonKeySession;
-import org.keycloak.adapters.config.AdapterConfig;
+import org.keycloak.representations.config.AdapterConfig;
import org.keycloak.representations.SkeletonKeyToken;
import javax.management.ObjectName;
diff --git a/integration/as7-eap6/adapter/src/main/java/org/keycloak/adapters/as7/BearerTokenAuthenticatorValve.java b/integration/as7-eap6/adapter/src/main/java/org/keycloak/adapters/as7/BearerTokenAuthenticatorValve.java
index 2f5e379a0e..6ee7141f08 100755
--- a/integration/as7-eap6/adapter/src/main/java/org/keycloak/adapters/as7/BearerTokenAuthenticatorValve.java
+++ b/integration/as7-eap6/adapter/src/main/java/org/keycloak/adapters/as7/BearerTokenAuthenticatorValve.java
@@ -13,7 +13,7 @@ import org.jboss.logging.Logger;
import org.keycloak.ResourceMetadata;
import org.keycloak.SkeletonKeySession;
import org.keycloak.adapters.as7.config.CatalinaAdapterConfigLoader;
-import org.keycloak.adapters.config.AdapterConfig;
+import org.keycloak.representations.config.AdapterConfig;
import org.keycloak.adapters.config.AdapterConfigLoader;
import javax.security.auth.login.LoginException;
diff --git a/integration/as7-eap6/adapter/src/main/java/org/keycloak/adapters/as7/CorsPreflightChecker.java b/integration/as7-eap6/adapter/src/main/java/org/keycloak/adapters/as7/CorsPreflightChecker.java
index f48ff6cc8b..5c323d861c 100755
--- a/integration/as7-eap6/adapter/src/main/java/org/keycloak/adapters/as7/CorsPreflightChecker.java
+++ b/integration/as7-eap6/adapter/src/main/java/org/keycloak/adapters/as7/CorsPreflightChecker.java
@@ -3,7 +3,7 @@ package org.keycloak.adapters.as7;
import org.apache.catalina.connector.Request;
import org.apache.catalina.connector.Response;
import org.jboss.logging.Logger;
-import org.keycloak.adapters.config.AdapterConfig;
+import org.keycloak.representations.config.AdapterConfig;
/**
* @author Bill Burke
diff --git a/integration/as7-eap6/adapter/src/main/java/org/keycloak/adapters/as7/OAuthAuthenticatorValve.java b/integration/as7-eap6/adapter/src/main/java/org/keycloak/adapters/as7/OAuthAuthenticatorValve.java
index 2118b765f6..1a2e1ef01a 100755
--- a/integration/as7-eap6/adapter/src/main/java/org/keycloak/adapters/as7/OAuthAuthenticatorValve.java
+++ b/integration/as7-eap6/adapter/src/main/java/org/keycloak/adapters/as7/OAuthAuthenticatorValve.java
@@ -17,7 +17,7 @@ import org.keycloak.ResourceMetadata;
import org.keycloak.SkeletonKeyPrincipal;
import org.keycloak.SkeletonKeySession;
import org.keycloak.adapters.as7.config.CatalinaAdapterConfigLoader;
-import org.keycloak.adapters.config.AdapterConfig;
+import org.keycloak.representations.config.AdapterConfig;
import org.keycloak.adapters.config.RealmConfiguration;
import org.keycloak.adapters.config.RealmConfigurationLoader;
import org.keycloak.jose.jws.JWSInput;
diff --git a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/AuthenticatedActionsHandler.java b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/AuthenticatedActionsHandler.java
index 9d0b2fbcc7..e294a2e965 100755
--- a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/AuthenticatedActionsHandler.java
+++ b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/AuthenticatedActionsHandler.java
@@ -5,7 +5,7 @@ import io.undertow.server.HttpServerExchange;
import io.undertow.util.Headers;
import org.jboss.logging.Logger;
import org.keycloak.SkeletonKeySession;
-import org.keycloak.adapters.config.AdapterConfig;
+import org.keycloak.representations.config.AdapterConfig;
import org.keycloak.representations.SkeletonKeyToken;
import javax.servlet.ServletException;
diff --git a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/KeycloakAuthenticationMechanism.java b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/KeycloakAuthenticationMechanism.java
index 749c6b0d11..5183d7a026 100755
--- a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/KeycloakAuthenticationMechanism.java
+++ b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/KeycloakAuthenticationMechanism.java
@@ -10,7 +10,7 @@ import org.keycloak.adapters.config.RealmConfiguration;
import org.keycloak.ResourceMetadata;
import org.keycloak.SkeletonKeyPrincipal;
import org.keycloak.SkeletonKeySession;
-import org.keycloak.adapters.config.AdapterConfig;
+import org.keycloak.representations.config.AdapterConfig;
import org.keycloak.representations.SkeletonKeyToken;
import java.security.Principal;
diff --git a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/KeycloakServletExtension.java b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/KeycloakServletExtension.java
index 02a39d4094..fa4ff2ecd8 100755
--- a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/KeycloakServletExtension.java
+++ b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/KeycloakServletExtension.java
@@ -7,7 +7,7 @@ import io.undertow.servlet.ServletExtension;
import io.undertow.servlet.api.DeploymentInfo;
import io.undertow.servlet.api.ServletSessionConfig;
import org.jboss.logging.Logger;
-import org.keycloak.adapters.config.AdapterConfig;
+import org.keycloak.representations.config.AdapterConfig;
import org.keycloak.adapters.config.RealmConfigurationLoader;
import javax.servlet.ServletContext;
diff --git a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/PreflightCorsHandler.java b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/PreflightCorsHandler.java
index 095ffa08e7..f56af7355e 100755
--- a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/PreflightCorsHandler.java
+++ b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/PreflightCorsHandler.java
@@ -5,7 +5,7 @@ import io.undertow.server.HttpHandler;
import io.undertow.server.HttpServerExchange;
import io.undertow.util.HttpString;
import org.jboss.logging.Logger;
-import org.keycloak.adapters.config.AdapterConfig;
+import org.keycloak.representations.config.AdapterConfig;
/**
* @author Bill Burke
diff --git a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/ServletAuthenticatedActionsHandler.java b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/ServletAuthenticatedActionsHandler.java
index 19abc79ba6..d724d46a23 100755
--- a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/ServletAuthenticatedActionsHandler.java
+++ b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/ServletAuthenticatedActionsHandler.java
@@ -5,7 +5,7 @@ import io.undertow.server.HttpHandler;
import io.undertow.server.HttpServerExchange;
import io.undertow.servlet.handlers.ServletRequestContext;
import org.keycloak.SkeletonKeySession;
-import org.keycloak.adapters.config.AdapterConfig;
+import org.keycloak.representations.config.AdapterConfig;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
diff --git a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/ServletKeycloakAuthenticationMechanism.java b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/ServletKeycloakAuthenticationMechanism.java
index 9df6863d78..4c504c2cc0 100755
--- a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/ServletKeycloakAuthenticationMechanism.java
+++ b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/ServletKeycloakAuthenticationMechanism.java
@@ -6,7 +6,7 @@ import io.undertow.servlet.handlers.ServletRequestContext;
import org.keycloak.adapters.config.RealmConfiguration;
import org.keycloak.ResourceMetadata;
import org.keycloak.SkeletonKeySession;
-import org.keycloak.adapters.config.AdapterConfig;
+import org.keycloak.representations.config.AdapterConfig;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
diff --git a/services/src/main/java/org/keycloak/services/managers/ApplicationManager.java b/services/src/main/java/org/keycloak/services/managers/ApplicationManager.java
index 1e5a24f1a9..fd05120c67 100755
--- a/services/src/main/java/org/keycloak/services/managers/ApplicationManager.java
+++ b/services/src/main/java/org/keycloak/services/managers/ApplicationManager.java
@@ -7,8 +7,9 @@ import org.keycloak.models.RealmModel;
import org.keycloak.models.RoleModel;
import org.keycloak.models.UserCredentialModel;
import org.keycloak.models.UserModel;
+import org.keycloak.representations.config.AdapterConfig;
+import org.keycloak.representations.config.BaseAdapterConfig;
import org.keycloak.representations.idm.ApplicationRepresentation;
-import org.keycloak.representations.idm.ApplicationInstallationRepresentation;
import org.keycloak.representations.idm.CredentialRepresentation;
import org.keycloak.representations.idm.RoleRepresentation;
import org.keycloak.representations.idm.ScopeMappingRepresentation;
@@ -175,16 +176,17 @@ public class ApplicationManager {
}
- public ApplicationInstallationRepresentation toInstallationRepresentation(RealmModel realmModel, ApplicationModel applicationModel, URI baseUri) {
- ApplicationInstallationRepresentation rep = new ApplicationInstallationRepresentation();
+ public BaseAdapterConfig toInstallationRepresentation(RealmModel realmModel, ApplicationModel applicationModel, URI baseUri) {
+ BaseAdapterConfig rep = new BaseAdapterConfig();
rep.setRealm(realmModel.getId());
- rep.setRealmPublicKey(realmModel.getPublicKeyPem());
+ rep.setRealmKey(realmModel.getPublicKeyPem());
rep.setSslNotRequired(realmModel.isSslNotRequired());
rep.setAuthUrl(Urls.realmLoginPage(baseUri, realmModel.getId()).toString());
rep.setCodeUrl(Urls.realmCode(baseUri, realmModel.getId()).toString());
+ rep.setUseResourceRoleMappings(applicationModel.getRoles().size() > 0);
- rep.setResource(applicationModel.getId());
+ rep.setResource(applicationModel.getName());
Map creds = new HashMap();
creds.put(CredentialRepresentation.PASSWORD, "INSERT APPLICATION PASSWORD");
diff --git a/services/src/main/java/org/keycloak/services/resources/admin/ApplicationResource.java b/services/src/main/java/org/keycloak/services/resources/admin/ApplicationResource.java
index 0c05fc9c17..b65372c478 100755
--- a/services/src/main/java/org/keycloak/services/resources/admin/ApplicationResource.java
+++ b/services/src/main/java/org/keycloak/services/resources/admin/ApplicationResource.java
@@ -7,11 +7,13 @@ import org.keycloak.models.ApplicationModel;
import org.keycloak.models.KeycloakSession;
import org.keycloak.models.RealmModel;
import org.keycloak.models.UserCredentialModel;
-import org.keycloak.representations.idm.ApplicationInstallationRepresentation;
+import org.keycloak.representations.config.AdapterConfig;
+import org.keycloak.representations.config.BaseAdapterConfig;
import org.keycloak.representations.idm.ApplicationRepresentation;
import org.keycloak.representations.idm.CredentialRepresentation;
import org.keycloak.services.managers.ApplicationManager;
import org.keycloak.services.managers.RealmManager;
+import org.keycloak.util.JsonSerialization;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
@@ -68,11 +70,10 @@ public class ApplicationResource extends RoleContainerResource {
@Produces(MediaType.APPLICATION_JSON)
public String getInstallation() throws IOException {
ApplicationManager applicationManager = new ApplicationManager(new RealmManager(session));
- ApplicationInstallationRepresentation rep = applicationManager.toInstallationRepresentation(realm, application, uriInfo.getBaseUri());
+ BaseAdapterConfig rep = applicationManager.toInstallationRepresentation(realm, application, uriInfo.getBaseUri());
// TODO Temporary solution to pretty-print
- ObjectMapper mapper = new ObjectMapper();
- return mapper.writerWithDefaultPrettyPrinter().writeValueAsString(rep);
+ return JsonSerialization.mapper.writerWithDefaultPrettyPrinter().writeValueAsString(rep);
}
@DELETE