diff --git a/distribution/pom.xml b/distribution/pom.xml index c9feefa493a..d2b8affb0c0 100755 --- a/distribution/pom.xml +++ b/distribution/pom.xml @@ -41,6 +41,7 @@ + saml-adapters galleon-feature-packs licenses-common maven-plugins diff --git a/distribution/saml-adapters/pom.xml b/distribution/saml-adapters/pom.xml new file mode 100755 index 00000000000..e0bf923961d --- /dev/null +++ b/distribution/saml-adapters/pom.xml @@ -0,0 +1,37 @@ + + + + + keycloak-distribution-parent + org.keycloak + 999.0.0-SNAPSHOT + + + SAML Adapters Distribution Parent + + 4.0.0 + + keycloak-saml-adapters-distribution-parent + pom + + + wildfly-adapter + + + diff --git a/distribution/saml-adapters/shared-cli/adapter-elytron-install-saml-offline.cli b/distribution/saml-adapters/shared-cli/adapter-elytron-install-saml-offline.cli new file mode 100755 index 00000000000..75e9390b707 --- /dev/null +++ b/distribution/saml-adapters/shared-cli/adapter-elytron-install-saml-offline.cli @@ -0,0 +1,61 @@ +embed-server --server-config=${server.config:standalone.xml} + +if (outcome != success) of /extension=org.keycloak.keycloak-saml-adapter-subsystem:read-resource + /extension=org.keycloak.keycloak-saml-adapter-subsystem/:add(module=org.keycloak.keycloak-saml-adapter-subsystem) +else + echo Keycloak SAML Extension already installed +end-if + +if (outcome != success) of /subsystem=keycloak-saml:read-resource + /subsystem=keycloak-saml:add +else + echo Keycloak SAML Subsystem already installed +end-if + +if (outcome != success) of /subsystem=elytron/custom-realm=KeycloakSAMLRealm:read-resource + /subsystem=elytron/custom-realm=KeycloakSAMLRealm:add(class-name=org.keycloak.adapters.saml.elytron.KeycloakSecurityRealm, module=org.keycloak.keycloak-saml-wildfly-elytron-adapter) +else + echo Keycloak SAML Realm already installed +end-if + +if (outcome != success) of /subsystem=elytron/security-domain=KeycloakDomain:read-resource + /subsystem=elytron/security-domain=KeycloakDomain:add(default-realm=KeycloakSAMLRealm,permission-mapper=default-permission-mapper,security-event-listener=local-audit,realms=[{realm=KeycloakSAMLRealm}]) +else + echo Keycloak Security Domain already installed. Trying to install Keycloak SAML Realm. + /subsystem=elytron/security-domain=KeycloakDomain:list-add(name=realms, value={realm=KeycloakSAMLRealm}) +end-if + +if (outcome != success) of /subsystem=elytron/constant-realm-mapper=keycloak-saml-realm-mapper:read-resource + /subsystem=elytron/constant-realm-mapper=keycloak-saml-realm-mapper:add(realm-name=KeycloakSAMLRealm) +else + echo Keycloak SAML Realm Mapper already installed +end-if + +if (outcome != success) of /subsystem=elytron/service-loader-http-server-mechanism-factory=keycloak-saml-http-server-mechanism-factory:read-resource + /subsystem=elytron/service-loader-http-server-mechanism-factory=keycloak-saml-http-server-mechanism-factory:add(module=org.keycloak.keycloak-saml-wildfly-elytron-adapter) +else + echo Keycloak SAML HTTP Mechanism Factory already installed +end-if + +if (outcome != success) of /subsystem=elytron/aggregate-http-server-mechanism-factory=keycloak-http-server-mechanism-factory:read-resource + /subsystem=elytron/aggregate-http-server-mechanism-factory=keycloak-http-server-mechanism-factory:add(http-server-mechanism-factories=[keycloak-saml-http-server-mechanism-factory, global]) +else + echo Keycloak HTTP Mechanism Factory already installed. Trying to install Keycloak SAML HTTP Mechanism Factory. + /subsystem=elytron/aggregate-http-server-mechanism-factory=keycloak-http-server-mechanism-factory:list-add(name=http-server-mechanism-factories, value=keycloak-saml-http-server-mechanism-factory) +end-if + +if (outcome != success) of /subsystem=elytron/http-authentication-factory=keycloak-http-authentication:read-resource + /subsystem=elytron/http-authentication-factory=keycloak-http-authentication:add(security-domain=KeycloakDomain,http-server-mechanism-factory=keycloak-http-server-mechanism-factory,mechanism-configurations=[{mechanism-name=KEYCLOAK-SAML,mechanism-realm-configurations=[{realm-name=KeycloakSAMLCRealm,realm-mapper=keycloak-saml-realm-mapper}]}]) +else + echo Keycloak HTTP Authentication Factory already installed. Trying to install Keycloak SAML Mechanism Configuration + /subsystem=elytron/http-authentication-factory=keycloak-http-authentication:list-add(name=mechanism-configurations, value={mechanism-name=KEYCLOAK-SAML,mechanism-realm-configurations=[{realm-name=KeycloakSAMLRealm,realm-mapper=keycloak-saml-realm-mapper}]}) +end-if + +if (outcome != success) of /subsystem=undertow/application-security-domain=other:read-resource + /subsystem=undertow/application-security-domain=other:add(http-authentication-factory=keycloak-http-authentication) +else + batch + /subsystem=undertow/application-security-domain=other:undefine-attribute(name=security-domain) + /subsystem=undertow/application-security-domain=other:write-attribute(name=http-authentication-factory,value=keycloak-http-authentication) + run-batch +end-if diff --git a/distribution/saml-adapters/shared-cli/adapter-elytron-install-saml.cli b/distribution/saml-adapters/shared-cli/adapter-elytron-install-saml.cli new file mode 100755 index 00000000000..dbd1efb7337 --- /dev/null +++ b/distribution/saml-adapters/shared-cli/adapter-elytron-install-saml.cli @@ -0,0 +1,59 @@ +if (outcome != success) of /extension=org.keycloak.keycloak-saml-adapter-subsystem:read-resource + /extension=org.keycloak.keycloak-saml-adapter-subsystem/:add(module=org.keycloak.keycloak-saml-adapter-subsystem) +else + echo Keycloak SAML Extension already installed +end-if + +if (outcome != success) of /subsystem=keycloak-saml:read-resource + /subsystem=keycloak-saml:add +else + echo Keycloak SAML Subsystem already installed +end-if + +if (outcome != success) of /subsystem=elytron/custom-realm=KeycloakSAMLRealm:read-resource + /subsystem=elytron/custom-realm=KeycloakSAMLRealm:add(class-name=org.keycloak.adapters.saml.elytron.KeycloakSecurityRealm, module=org.keycloak.keycloak-saml-wildfly-elytron-adapter) +else + echo Keycloak SAML Realm already installed +end-if + +if (outcome != success) of /subsystem=elytron/security-domain=KeycloakDomain:read-resource + /subsystem=elytron/security-domain=KeycloakDomain:add(default-realm=KeycloakSAMLRealm,permission-mapper=default-permission-mapper,security-event-listener=local-audit,realms=[{realm=KeycloakSAMLRealm}]) +else + echo Keycloak Security Domain already installed. Trying to install Keycloak SAML Realm. + /subsystem=elytron/security-domain=KeycloakDomain:list-add(name=realms, value={realm=KeycloakSAMLRealm}) +end-if + +if (outcome != success) of /subsystem=elytron/constant-realm-mapper=keycloak-saml-realm-mapper:read-resource + /subsystem=elytron/constant-realm-mapper=keycloak-saml-realm-mapper:add(realm-name=KeycloakSAMLRealm) +else + echo Keycloak SAML Realm Mapper already installed +end-if + +if (outcome != success) of /subsystem=elytron/service-loader-http-server-mechanism-factory=keycloak-saml-http-server-mechanism-factory:read-resource + /subsystem=elytron/service-loader-http-server-mechanism-factory=keycloak-saml-http-server-mechanism-factory:add(module=org.keycloak.keycloak-saml-wildfly-elytron-adapter) +else + echo Keycloak SAML HTTP Mechanism Factory already installed +end-if + +if (outcome != success) of /subsystem=elytron/aggregate-http-server-mechanism-factory=keycloak-http-server-mechanism-factory:read-resource + /subsystem=elytron/aggregate-http-server-mechanism-factory=keycloak-http-server-mechanism-factory:add(http-server-mechanism-factories=[keycloak-saml-http-server-mechanism-factory, global]) +else + echo Keycloak HTTP Mechanism Factory already installed. Trying to install Keycloak SAML HTTP Mechanism Factory. + /subsystem=elytron/aggregate-http-server-mechanism-factory=keycloak-http-server-mechanism-factory:list-add(name=http-server-mechanism-factories, value=keycloak-saml-http-server-mechanism-factory) +end-if + +if (outcome != success) of /subsystem=elytron/http-authentication-factory=keycloak-http-authentication:read-resource + /subsystem=elytron/http-authentication-factory=keycloak-http-authentication:add(security-domain=KeycloakDomain,http-server-mechanism-factory=keycloak-http-server-mechanism-factory,mechanism-configurations=[{mechanism-name=KEYCLOAK-SAML,mechanism-realm-configurations=[{realm-name=KeycloakSAMLCRealm,realm-mapper=keycloak-saml-realm-mapper}]}]) +else + echo Keycloak HTTP Authentication Factory already installed. Trying to install Keycloak SAML Mechanism Configuration + /subsystem=elytron/http-authentication-factory=keycloak-http-authentication:list-add(name=mechanism-configurations, value={mechanism-name=KEYCLOAK-SAML,mechanism-realm-configurations=[{realm-name=KeycloakSAMLRealm,realm-mapper=keycloak-saml-realm-mapper}]}) +end-if + +if (outcome != success) of /subsystem=undertow/application-security-domain=other:read-resource + /subsystem=undertow/application-security-domain=other:add(http-authentication-factory=keycloak-http-authentication) +else + batch + /subsystem=undertow/application-security-domain=other:undefine-attribute(name=security-domain) + /subsystem=undertow/application-security-domain=other:write-attribute(name=http-authentication-factory,value=keycloak-http-authentication) + run-batch +end-if diff --git a/distribution/saml-adapters/shared-cli/adapter-install-saml-offline.cli b/distribution/saml-adapters/shared-cli/adapter-install-saml-offline.cli new file mode 100755 index 00000000000..8c3ca4ca588 --- /dev/null +++ b/distribution/saml-adapters/shared-cli/adapter-install-saml-offline.cli @@ -0,0 +1,3 @@ +embed-server --server-config=${server.config:standalone.xml} +/extension=org.keycloak.keycloak-saml-adapter-subsystem/:add(module=org.keycloak.keycloak-saml-adapter-subsystem) +/subsystem=keycloak-saml:add \ No newline at end of file diff --git a/distribution/saml-adapters/shared-cli/adapter-install-saml.cli b/distribution/saml-adapters/shared-cli/adapter-install-saml.cli new file mode 100755 index 00000000000..d1bdfa3ca4d --- /dev/null +++ b/distribution/saml-adapters/shared-cli/adapter-install-saml.cli @@ -0,0 +1,2 @@ +/extension=org.keycloak.keycloak-saml-adapter-subsystem/:add(module=org.keycloak.keycloak-saml-adapter-subsystem) +/subsystem=keycloak-saml:add \ No newline at end of file diff --git a/distribution/saml-adapters/wildfly-adapter/pom.xml b/distribution/saml-adapters/wildfly-adapter/pom.xml new file mode 100755 index 00000000000..b019240ae07 --- /dev/null +++ b/distribution/saml-adapters/wildfly-adapter/pom.xml @@ -0,0 +1,38 @@ + + + + + keycloak-parent + org.keycloak + 999.0.0-SNAPSHOT + ../../../pom.xml + + Keycloak Wildfly SAML Adapter + + 4.0.0 + + keycloak-saml-wildfly-adapter-dist-pom + pom + + + wildfly-modules + wildfly-adapter-zip + + + diff --git a/distribution/saml-adapters/wildfly-adapter/wildfly-adapter-zip/assembly.xml b/distribution/saml-adapters/wildfly-adapter/wildfly-adapter-zip/assembly.xml new file mode 100755 index 00000000000..feb22b8d389 --- /dev/null +++ b/distribution/saml-adapters/wildfly-adapter/wildfly-adapter-zip/assembly.xml @@ -0,0 +1,58 @@ + + + + war-dist + + + zip + tar.gz + + false + + + + ${project.build.directory}/unpacked/modules + + **/** + + modules + + + ${project.build.directory}/unpacked/licenses + docs/licenses-keycloak + + + + + ../../shared-cli/adapter-install-saml.cli + bin + + + ../../shared-cli/adapter-install-saml-offline.cli + bin + + + ../../shared-cli/adapter-elytron-install-saml.cli + bin + + + ../../shared-cli/adapter-elytron-install-saml-offline.cli + bin + + + diff --git a/distribution/saml-adapters/wildfly-adapter/wildfly-adapter-zip/pom.xml b/distribution/saml-adapters/wildfly-adapter/wildfly-adapter-zip/pom.xml new file mode 100755 index 00000000000..d503885a0fb --- /dev/null +++ b/distribution/saml-adapters/wildfly-adapter/wildfly-adapter-zip/pom.xml @@ -0,0 +1,93 @@ + + + + 4.0.0 + + keycloak-parent + org.keycloak + 999.0.0-SNAPSHOT + ../../../../pom.xml + + + keycloak-saml-wildfly-adapter-dist + pom + Keycloak SAML Wildfly Adapter Distro + + + + + org.keycloak + keycloak-saml-wildfly-modules + zip + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack + prepare-package + + unpack + + + + + org.keycloak + keycloak-saml-wildfly-modules + zip + ${project.build.directory}/unpacked + + + + + + + + + maven-assembly-plugin + + + assemble + package + + single + + + + assembly.xml + + + target + + + target/assembly/work + + false + + + + + + + diff --git a/distribution/saml-adapters/wildfly-adapter/wildfly-modules/assembly.xml b/distribution/saml-adapters/wildfly-adapter/wildfly-modules/assembly.xml new file mode 100755 index 00000000000..9d38002cfe3 --- /dev/null +++ b/distribution/saml-adapters/wildfly-adapter/wildfly-modules/assembly.xml @@ -0,0 +1,43 @@ + + + + dist + + + zip + + false + + + + src/main/resources/licenses/keycloak + licenses + + licenses.xml + + + + ${project.build.directory}/licenses + licenses + + + ${project.build.directory}/modules + modules + + + diff --git a/distribution/saml-adapters/wildfly-adapter/wildfly-modules/build.xml b/distribution/saml-adapters/wildfly-adapter/wildfly-modules/build.xml new file mode 100755 index 00000000000..48329548cbf --- /dev/null +++ b/distribution/saml-adapters/wildfly-adapter/wildfly-modules/build.xml @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/distribution/saml-adapters/wildfly-adapter/wildfly-modules/lib.xml b/distribution/saml-adapters/wildfly-adapter/wildfly-modules/lib.xml new file mode 100755 index 00000000000..005acd68eee --- /dev/null +++ b/distribution/saml-adapters/wildfly-adapter/wildfly-modules/lib.xml @@ -0,0 +1,270 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + "; + project.setProperty("current.maven.root", root); + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + "; + if(path.indexOf('${') != -1) { + throw "Module resource root not found, make sure it is listed in build/pom.xml" + path; + } + if(attributes.get("jandex") == "true" ) { + root = root + "\n\t"; + } + project.setProperty("current.resource.root", root); + ]]> + + + diff --git a/distribution/saml-adapters/wildfly-adapter/wildfly-modules/pom.xml b/distribution/saml-adapters/wildfly-adapter/wildfly-modules/pom.xml new file mode 100755 index 00000000000..8d7e26856ae --- /dev/null +++ b/distribution/saml-adapters/wildfly-adapter/wildfly-modules/pom.xml @@ -0,0 +1,226 @@ + + + + + + 4.0.0 + + + keycloak-parent + org.keycloak + 999.0.0-SNAPSHOT + ../../../../pom.xml + + + keycloak-saml-wildfly-modules + + Keycloak SAML Wildfly Modules + pom + + + org.keycloak + keycloak-common + + + * + * + + + + + org.keycloak + keycloak-adapter-spi + + + * + * + + + + + org.keycloak + keycloak-saml-core + + + * + * + + + + + org.keycloak + keycloak-saml-adapter-api-public + + + * + * + + + + + org.keycloak + keycloak-saml-adapter-core + + + * + * + + + + + org.keycloak + keycloak-jboss-adapter-core + + + * + * + + + + + org.keycloak + keycloak-saml-core-public + + + * + * + + + + + org.keycloak + keycloak-saml-wildfly-elytron-adapter + + + * + * + + + + + org.keycloak + keycloak-saml-wildfly-subsystem + + + * + * + + + + + org.keycloak + keycloak-saml-adapter-galleon-pack + zip + + + * + * + + + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + false + + + build-dist + + run + + compile + + + + + + + + + + + + org.jboss + jandex + 1.0.3.Final + + + ant-contrib + ant-contrib + 1.0b3 + + + ant + ant + + + + + org.apache.ant + ant-apache-bsf + 1.9.3 + + + org.apache.bsf + bsf-api + 3.1 + + + rhino + js + 1.7R2 + + + + + maven-assembly-plugin + + + assemble + package + + single + + + + assembly.xml + + + target + + + target/assembly/work + + false + + + + + + org.keycloak + keycloak-distribution-licenses-maven-plugin + + + + diff --git a/distribution/saml-adapters/wildfly-adapter/wildfly-modules/src/main/resources/licenses/keycloak/licenses.xml b/distribution/saml-adapters/wildfly-adapter/wildfly-modules/src/main/resources/licenses/keycloak/licenses.xml new file mode 100644 index 00000000000..bac7cdfbcc5 --- /dev/null +++ b/distribution/saml-adapters/wildfly-adapter/wildfly-modules/src/main/resources/licenses/keycloak/licenses.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/pom.xml b/pom.xml index 3c35c5d995a..8ba8dd59992 100644 --- a/pom.xml +++ b/pom.xml @@ -1098,7 +1098,12 @@ keycloak-rest-admin-ui-ext ${project.version} - + + org.keycloak + keycloak-saml-wildfly-modules + ${project.version} + zip + org.keycloak keycloak-quarkus-dist