diff --git a/testsuite/integration-arquillian/servers/eap7/pom.xml b/testsuite/integration-arquillian/servers/eap7/pom.xml index 81d4ef85ff..d61256aba4 100644 --- a/testsuite/integration-arquillian/servers/eap7/pom.xml +++ b/testsuite/integration-arquillian/servers/eap7/pom.xml @@ -238,5 +238,67 @@ + + ssl + + + auth.server.ssl.required + + + + + + org.codehaus.mojo + xml-maven-plugin + + + configure-adapter-subsystem-security + process-resources + + transform + + + + + ${keycloak.server.home}/standalone/configuration + + standalone.xml + + src/main/xslt/security.xsl + ${keycloak.server.home}/standalone/configuration + + + + + + + + maven-resources-plugin + 2.7 + + + copy-keystore + process-resources + + copy-resources + + + ${keycloak.server.home}/standalone/configuration + + + src/main/keystore + + keycloak.jks + keycloak.truststore + + + + + + + + + + diff --git a/testsuite/integration-arquillian/servers/eap7/src/main/keystore/keycloak.jks b/testsuite/integration-arquillian/servers/eap7/src/main/keystore/keycloak.jks new file mode 100644 index 0000000000..81570ab529 Binary files /dev/null and b/testsuite/integration-arquillian/servers/eap7/src/main/keystore/keycloak.jks differ diff --git a/testsuite/integration-arquillian/servers/eap7/src/main/keystore/keycloak.truststore b/testsuite/integration-arquillian/servers/eap7/src/main/keystore/keycloak.truststore new file mode 100644 index 0000000000..2df5170f9b Binary files /dev/null and b/testsuite/integration-arquillian/servers/eap7/src/main/keystore/keycloak.truststore differ diff --git a/testsuite/integration-arquillian/servers/eap7/src/main/xslt/security.xsl b/testsuite/integration-arquillian/servers/eap7/src/main/xslt/security.xsl new file mode 100644 index 0000000000..4c9667361d --- /dev/null +++ b/testsuite/integration-arquillian/servers/eap7/src/main/xslt/security.xsl @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/DeploymentArchiveProcessor.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/DeploymentArchiveProcessor.java index 1f74b30ba4..8fba9b0bb4 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/DeploymentArchiveProcessor.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/DeploymentArchiveProcessor.java @@ -35,6 +35,8 @@ public class DeploymentArchiveProcessor implements ApplicationArchiveProcessor { protected final Logger log = org.jboss.logging.Logger.getLogger(this.getClass()); + private final boolean authServerSslRequired = Boolean.parseBoolean(System.getProperty("auth.server.ssl.required")); + public static final String WEBXML_PATH = "/WEB-INF/web.xml"; public static final String ADAPTER_CONFIG_PATH = "/WEB-INF/keycloak.json"; public static final String ADAPTER_CONFIG_PATH_TENANT1 = "/WEB-INF/classes/tenant1-keycloak.json"; @@ -74,10 +76,18 @@ public class DeploymentArchiveProcessor implements ApplicationArchiveProcessor { log.info("Modyfying saml adapter config in " + archive.getName()); Document doc = loadXML(archive.get("WEB-INF/keycloak-saml.xml").getAsset().openStream()); - - modifyDocElementAttribute(doc, "SingleSignOnService", "bindingUrl", "8080", System.getProperty("auth.server.http.port", null)); - modifyDocElementAttribute(doc, "SingleLogoutService", "postBindingUrl", "8080", System.getProperty("auth.server.http.port", null)); - modifyDocElementAttribute(doc, "SingleLogoutService", "redirectBindingUrl", "8080", System.getProperty("auth.server.http.port", null)); + if (authServerSslRequired) { + modifyDocElementAttribute(doc, "SingleSignOnService", "bindingUrl", "8080", System.getProperty("auth.server.https.port", null)); + modifyDocElementAttribute(doc, "SingleSignOnService", "bindingUrl", "http", "https"); + modifyDocElementAttribute(doc, "SingleLogoutService", "postBindingUrl", "8080", System.getProperty("auth.server.https.port", null)); + modifyDocElementAttribute(doc, "SingleLogoutService", "postBindingUrl", "http", "https"); + modifyDocElementAttribute(doc, "SingleLogoutService", "redirectBindingUrl", "8080", System.getProperty("auth.server.https.port", null)); + modifyDocElementAttribute(doc, "SingleLogoutService", "redirectBindingUrl", "http", "https"); + } else { + modifyDocElementAttribute(doc, "SingleSignOnService", "bindingUrl", "8080", System.getProperty("auth.server.http.port", null)); + modifyDocElementAttribute(doc, "SingleLogoutService", "postBindingUrl", "8080", System.getProperty("auth.server.http.port", null)); + modifyDocElementAttribute(doc, "SingleLogoutService", "redirectBindingUrl", "8080", System.getProperty("auth.server.http.port", null)); + } try { archive.add(new StringAsset(IOUtil.documentToString(doc)), adapterConfigPath); diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/provider/URLProvider.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/provider/URLProvider.java index a3447cc2af..95b6003807 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/provider/URLProvider.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/provider/URLProvider.java @@ -62,7 +62,8 @@ public class URLProvider extends URLResourceProvider { if (url.getPort() == 8080) { for (Annotation a : qualifiers) { if (OperateOnDeployment.class.isAssignableFrom(a.annotationType())) { - url = new URL(fixedUrl.toExternalForm().replace("8080", System.getProperty("app.server.http.port", null)) + "/" + ((OperateOnDeployment) a).value()); + String port = appServerSslRequired ? System.getProperty("app.server.https.port", "8643"):System.getProperty("app.server.http.port", "8280"); + url = new URL(fixedUrl.toExternalForm().replace("8080", port) + "/" + ((OperateOnDeployment) a).value()); } } diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/page/AbstractPageWithInjectedUrl.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/page/AbstractPageWithInjectedUrl.java index 34149333e7..7ddf5ebd05 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/page/AbstractPageWithInjectedUrl.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/page/AbstractPageWithInjectedUrl.java @@ -18,8 +18,10 @@ public abstract class AbstractPageWithInjectedUrl extends AbstractPage { if (System.getProperty("app.server.eap6","false").equals("false")) { return null; } - try { + if(Boolean.parseBoolean(System.getProperty("app.server.ssl.required"))) { + return new URL("https://localhost:" + System.getProperty("app.server.https.port", "8543") + "/" + url); + }; return new URL("http://localhost:" + System.getProperty("app.server.http.port", "8180") + "/" + url); } catch (MalformedURLException e) { e.printStackTrace();