diff --git a/License.html b/License.html new file mode 100755 index 0000000000..6ae1dfd820 --- /dev/null +++ b/License.html @@ -0,0 +1,210 @@ + + + + +
+Apache License
+  Version 2.0, January 2004
+   http://www.apache.org/licenses/
+
+  TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+  1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+  2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+  3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+  4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+  5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+  6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+  7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+  8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+  9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+  END OF TERMS AND CONDITIONS
+
+  APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!)  The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+  Copyright [yyyy] [name of copyright owner]
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+    
+
+ + diff --git a/dist-as7/assembly.xml b/dist-as7/assembly.xml deleted file mode 100644 index 62241e2822..0000000000 --- a/dist-as7/assembly.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - distro - - - zip - tar.gz - - - false - - - - ${build.target.dir} - keycloak-${project.version} - - **/*.sh - domain/tmp/auth - standalone/tmp/auth - **/*-users.properties - - - - ${build.target.dir} - keycloak-${project.version} - - **/*.sh - - 0755 - - - ${build.target.dir} - keycloak-${project.version} - - **/*-users.properties - - 0600 - - - ${build.target.dir} - keycloak-${project.version} - - domain/tmp/auth - standalone/tmp/auth - - 0700 - - - - diff --git a/dist-as7/build.xml b/dist-as7/build.xml deleted file mode 100644 index c9bfd9589c..0000000000 --- a/dist-as7/build.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dist-as7/pom.xml b/dist-as7/pom.xml deleted file mode 100755 index 0999cfde03..0000000000 --- a/dist-as7/pom.xml +++ /dev/null @@ -1,125 +0,0 @@ - - - 4.0.0 - - - org.keycloak - keycloak-parent - 1.0-alpha-1-SNAPSHOT - - - keycloak-dist-as7 - Keycloak Dist AS7 - pom - - - ${project.build.directory}/keycloak-${project.version} - - - - - release-as7 - - - - org.keycloak - keycloak-server - 1.0-alpha-1-SNAPSHOT - war - - - org.jboss.as - jboss-as-dist - ${jboss.version} - zip - - - - - - - org.apache.maven.plugins - maven-deploy-plugin - - true - - - - org.apache.maven.plugins - maven-antrun-plugin - 1.7 - - - build - compile - - - - - - - - - run - - - - - - - org.codehaus.mojo - xml-maven-plugin - 1.0 - - - generate-resources - package - - transform - - - - - ${build.target.dir}/standalone/configuration - src/main/xslt/standalone.xsl - - standalone*.xml - - ${build.target.dir}/standalone/configuration - - - ${project.build.directory} - - - - - - - org.apache.maven.plugins - maven-assembly-plugin - - - assemble - package - - single - - - - assembly.xml - - keycloak-${project.version} - false - target/ - target/assembly/work - gnu - - - - - - - - - diff --git a/dist-as7/src/main/xslt/standalone.xsl b/dist-as7/src/main/xslt/standalone.xsl deleted file mode 100644 index 2507ba3604..0000000000 --- a/dist-as7/src/main/xslt/standalone.xsl +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - jdbc:h2:${jboss.server.data.dir}/keycloak;AUTO_SERVER=TRUE - h2 - - sa - sa - - - - - - - - - - - - diff --git a/dist/assembly.xml b/dist/assembly.xml deleted file mode 100644 index 62241e2822..0000000000 --- a/dist/assembly.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - distro - - - zip - tar.gz - - - false - - - - ${build.target.dir} - keycloak-${project.version} - - **/*.sh - domain/tmp/auth - standalone/tmp/auth - **/*-users.properties - - - - ${build.target.dir} - keycloak-${project.version} - - **/*.sh - - 0755 - - - ${build.target.dir} - keycloak-${project.version} - - **/*-users.properties - - 0600 - - - ${build.target.dir} - keycloak-${project.version} - - domain/tmp/auth - standalone/tmp/auth - - 0700 - - - - diff --git a/dist/build.xml b/dist/build.xml deleted file mode 100644 index d48480d445..0000000000 --- a/dist/build.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dist/pom.xml b/dist/pom.xml deleted file mode 100755 index 723961e009..0000000000 --- a/dist/pom.xml +++ /dev/null @@ -1,125 +0,0 @@ - - - 4.0.0 - - - org.keycloak - keycloak-parent - 1.0-alpha-1-SNAPSHOT - - - keycloak-dist - Keycloak Dist - pom - - - ${project.build.directory}/keycloak-${project.version} - - - - - release - - - - org.keycloak - keycloak-server - 1.0-alpha-1-SNAPSHOT - war - - - org.wildfly - wildfly-dist - ${wildfly.version} - zip - - - - - - - org.apache.maven.plugins - maven-deploy-plugin - - true - - - - org.apache.maven.plugins - maven-antrun-plugin - 1.7 - - - build - compile - - - - - - - - - run - - - - - - - org.codehaus.mojo - xml-maven-plugin - 1.0 - - - generate-resources - package - - transform - - - - - ${build.target.dir}/standalone/configuration - src/main/xslt/standalone.xsl - - standalone*.xml - - ${build.target.dir}/standalone/configuration - - - ${project.build.directory} - - - - - - - org.apache.maven.plugins - maven-assembly-plugin - - - assemble - package - - single - - - - assembly.xml - - keycloak-${project.version} - false - target/ - target/assembly/work - gnu - - - - - - - - - diff --git a/dist/src/main/xslt/standalone.xsl b/dist/src/main/xslt/standalone.xsl deleted file mode 100644 index 2507ba3604..0000000000 --- a/dist/src/main/xslt/standalone.xsl +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - jdbc:h2:${jboss.server.data.dir}/keycloak;AUTO_SERVER=TRUE - h2 - - sa - sa - - - - - - - - - - - - diff --git a/distribution/appliance-dist/assembly.xml b/distribution/appliance-dist/assembly.xml new file mode 100755 index 0000000000..329ff2ae50 --- /dev/null +++ b/distribution/appliance-dist/assembly.xml @@ -0,0 +1,66 @@ + + war-dist + + + zip + + true + + + + ${project.build.directory}/unpacked/examples + examples + + + ${project.build.directory}/unpacked/wildfly-${wildfly.version} + keycloak + + **/*.sh + + + + ${project.build.directory}/unpacked/wildfly-${wildfly.version} + keycloak + + **/*.sh + + 0755 + + + ${project.build.directory}/unpacked/deployments + keycloak/standalone/deployments + + + ${project.build.directory}/unpacked/adapter + keycloak + + + + + false + false + + org.keycloak:keycloak-wildfly-adapter-dist:zip + org.keycloak:keycloak-as7-adapter-dist:zip + org.keycloak:keycloak-eap6-adapter-dist:zip + + adapters + + + + diff --git a/distribution/appliance-dist/pom.xml b/distribution/appliance-dist/pom.xml new file mode 100755 index 0000000000..fe449e1700 --- /dev/null +++ b/distribution/appliance-dist/pom.xml @@ -0,0 +1,111 @@ + + 4.0.0 + + keycloak-parent + org.keycloak + 1.0-alpha-1-SNAPSHOT + ../../pom.xml + + + keycloak-appliance-dist-all + pom + Keycloak Appliance Distribution + + + + + org.keycloak + keycloak-wildfly-adapter-dist + ${project.version} + zip + + + org.keycloak + keycloak-as7-adapter-dist + ${project.version} + zip + + + org.keycloak + keycloak-eap6-adapter-dist + ${project.version} + zip + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + + unpack + prepare-package + + unpack + + + + + org.keycloak + keycloak-war-deployment + ${project.version} + zip + ${project.build.directory}/unpacked + + + org.wildfly + wildfly-dist + ${wildfly.version} + zip + ${project.build.directory}/unpacked + + + org.keycloak + keycloak-examples-docs-dist + ${project.version} + zip + ${project.build.directory}/unpacked + + + org.keycloak + keycloak-wildfly-adapter-dist + ${project.version} + zip + ${project.build.directory}/unpacked/adapter + + + + + + + + maven-assembly-plugin + 2.4 + + + assemble + package + + single + + + + assembly.xml + + + target + + + target/assembly/work + + false + + + + + + + + diff --git a/distribution/as7-adapter-zip/assembly.xml b/distribution/as7-adapter-zip/assembly.xml new file mode 100755 index 0000000000..4caee0732c --- /dev/null +++ b/distribution/as7-adapter-zip/assembly.xml @@ -0,0 +1,31 @@ + + war-dist + + + zip + + false + + + + ${project.build.directory}/unpacked + + org/keycloak/keycloak-undertow-adapter/** + + modules + + + + diff --git a/distribution/as7-adapter-zip/pom.xml b/distribution/as7-adapter-zip/pom.xml new file mode 100755 index 0000000000..f4b05c917c --- /dev/null +++ b/distribution/as7-adapter-zip/pom.xml @@ -0,0 +1,77 @@ + + 4.0.0 + + keycloak-parent + org.keycloak + 1.0-alpha-1-SNAPSHOT + ../../pom.xml + + + keycloak-as7-adapter-dist + pom + Keycloak AS7 Adapter Distro + + + + + org.keycloak + keycloak-as7-adapter + ${project.version} + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + + unpack + prepare-package + + unpack + + + + + org.keycloak + keycloak-jboss-modules + ${project.version} + zip + ${project.build.directory}/unpacked + + + + + + + + maven-assembly-plugin + 2.4 + + + assemble + package + + single + + + + assembly.xml + + + target + + + target/assembly/work + + false + + + + + + + + diff --git a/distribution/eap6-adapter-zip/assembly.xml b/distribution/eap6-adapter-zip/assembly.xml new file mode 100755 index 0000000000..6fe463bec2 --- /dev/null +++ b/distribution/eap6-adapter-zip/assembly.xml @@ -0,0 +1,31 @@ + + war-dist + + + zip + + false + + + + ${project.build.directory}/unpacked + + org/keycloak/keycloak-undertow-adapter/** + + modules/system/layers/base + + + + diff --git a/distribution/eap6-adapter-zip/pom.xml b/distribution/eap6-adapter-zip/pom.xml new file mode 100755 index 0000000000..2666428ef6 --- /dev/null +++ b/distribution/eap6-adapter-zip/pom.xml @@ -0,0 +1,77 @@ + + 4.0.0 + + keycloak-parent + org.keycloak + 1.0-alpha-1-SNAPSHOT + ../../pom.xml + + + keycloak-eap6-adapter-dist + pom + Keycloak EAP6 Adapter Distro + + + + + org.keycloak + keycloak-as7-adapter + ${project.version} + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + + unpack + prepare-package + + unpack + + + + + org.keycloak + keycloak-jboss-modules + ${project.version} + zip + ${project.build.directory}/unpacked + + + + + + + + maven-assembly-plugin + 2.4 + + + assemble + package + + single + + + + assembly.xml + + + target + + + target/assembly/work + + false + + + + + + + + diff --git a/distribution/examples-docs-zip/assembly.xml b/distribution/examples-docs-zip/assembly.xml new file mode 100755 index 0000000000..77b75306d7 --- /dev/null +++ b/distribution/examples-docs-zip/assembly.xml @@ -0,0 +1,27 @@ + + war-dist + + + zip + + false + + + + ../../ + + License.html + + + + + ../../examples + examples + + **/.svn/** + **/target/** + **/*.iml + + + + diff --git a/distribution/examples-docs-zip/pom.xml b/distribution/examples-docs-zip/pom.xml new file mode 100755 index 0000000000..2621391187 --- /dev/null +++ b/distribution/examples-docs-zip/pom.xml @@ -0,0 +1,47 @@ + + 4.0.0 + + keycloak-parent + org.keycloak + 1.0-alpha-1-SNAPSHOT + ../../pom.xml + + + keycloak-examples-docs-dist + pom + Keycloak Examples and Doc Distribution + + + + + + + + maven-assembly-plugin + 2.4 + + + assemble + package + + single + + + + assembly.xml + + + target + + + target/assembly/work + + false + + + + + + + + diff --git a/distribution/modules/assembly.xml b/distribution/modules/assembly.xml new file mode 100755 index 0000000000..098b1d8636 --- /dev/null +++ b/distribution/modules/assembly.xml @@ -0,0 +1,22 @@ + + dist + + + zip + + false + + + + ../../ + + License.html + + + + + ${project.build.directory}/modules + + + + diff --git a/distribution/modules/build.xml b/distribution/modules/build.xml new file mode 100755 index 0000000000..9ec84de424 --- /dev/null +++ b/distribution/modules/build.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/distribution/modules/lib.xml b/distribution/modules/lib.xml new file mode 100755 index 0000000000..c28dcf883c --- /dev/null +++ b/distribution/modules/lib.xml @@ -0,0 +1,277 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + "; + 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/modules/pom.xml b/distribution/modules/pom.xml new file mode 100755 index 0000000000..950e5d22fa --- /dev/null +++ b/distribution/modules/pom.xml @@ -0,0 +1,138 @@ + + + + + + 4.0.0 + + + keycloak-parent + org.keycloak + 1.0-alpha-1-SNAPSHOT + ../../pom.xml + + + keycloak-jboss-modules + + Keycloak JBoss Modules + pom + + + org.keycloak + keycloak-core + ${project.version} + + + org.keycloak + keycloak-adapter-core + ${project.version} + + + org.keycloak + keycloak-as7-adapter + ${project.version} + + + org.keycloak + keycloak-undertow-adapter + ${project.version} + + + org.bouncycastle + bcprov-jdk16 + + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + 1.7 + false + + + build-dist + + run + + compile + + + + + + + + + + + + org.jboss + jandex + 1.0.3.Final + + + ant-contrib + ant-contrib + 1.0b3 + + + ant + ant + + + + + + + maven-assembly-plugin + 2.4 + + + assemble + package + + single + + + + assembly.xml + + + target + + + target/assembly/work + + false + + + + + + + diff --git a/distribution/modules/src/main/resources/modules/org/bouncycastle/main/module.xml b/distribution/modules/src/main/resources/modules/org/bouncycastle/main/module.xml new file mode 100755 index 0000000000..d0ec17b9e1 --- /dev/null +++ b/distribution/modules/src/main/resources/modules/org/bouncycastle/main/module.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + diff --git a/distribution/modules/src/main/resources/modules/org/keycloak/keycloak-adapter-core/main/module.xml b/distribution/modules/src/main/resources/modules/org/keycloak/keycloak-adapter-core/main/module.xml new file mode 100755 index 0000000000..0aa0a29d7d --- /dev/null +++ b/distribution/modules/src/main/resources/modules/org/keycloak/keycloak-adapter-core/main/module.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + diff --git a/distribution/modules/src/main/resources/modules/org/keycloak/keycloak-as7-adapter/main/module.xml b/distribution/modules/src/main/resources/modules/org/keycloak/keycloak-as7-adapter/main/module.xml new file mode 100755 index 0000000000..f760b12395 --- /dev/null +++ b/distribution/modules/src/main/resources/modules/org/keycloak/keycloak-as7-adapter/main/module.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/distribution/modules/src/main/resources/modules/org/keycloak/keycloak-core/main/module.xml b/distribution/modules/src/main/resources/modules/org/keycloak/keycloak-core/main/module.xml new file mode 100755 index 0000000000..a58f0928ea --- /dev/null +++ b/distribution/modules/src/main/resources/modules/org/keycloak/keycloak-core/main/module.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + diff --git a/distribution/modules/src/main/resources/modules/org/keycloak/keycloak-undertow-adapter/main/module.xml b/distribution/modules/src/main/resources/modules/org/keycloak/keycloak-undertow-adapter/main/module.xml new file mode 100755 index 0000000000..f3090c1278 --- /dev/null +++ b/distribution/modules/src/main/resources/modules/org/keycloak/keycloak-undertow-adapter/main/module.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/distribution/pom.xml b/distribution/pom.xml new file mode 100755 index 0000000000..6358586ea3 --- /dev/null +++ b/distribution/pom.xml @@ -0,0 +1,38 @@ + + + keycloak-parent + org.keycloak + 1.0-alpha-1-SNAPSHOT + ../pom.xml + + Distribution + + 4.0.0 + + org.keycloak + distribution-pom + pom + + + + + org.apache.maven.plugins + maven-deploy-plugin + + true + + + + + + modules + as7-adapter-zip + eap6-adapter-zip + wildfly-adapter-zip + examples-docs-zip + war-zip + war-dist + appliance-dist + + diff --git a/distribution/war-dist/assembly.xml b/distribution/war-dist/assembly.xml new file mode 100755 index 0000000000..c237f5a04c --- /dev/null +++ b/distribution/war-dist/assembly.xml @@ -0,0 +1,43 @@ + + war-dist + + + zip + + true + + + + ${project.build.directory}/unpacked + + + + + + false + false + + org.keycloak:keycloak-wildfly-adapter-dist:zip + org.keycloak:keycloak-as7-adapter-dist:zip + org.keycloak:keycloak-eap6-adapter-dist:zip + + adapters + + + + diff --git a/distribution/war-dist/pom.xml b/distribution/war-dist/pom.xml new file mode 100755 index 0000000000..5009ffe53d --- /dev/null +++ b/distribution/war-dist/pom.xml @@ -0,0 +1,113 @@ + + 4.0.0 + + keycloak-parent + org.keycloak + 1.0-alpha-1-SNAPSHOT + ../../pom.xml + + + keycloak-war-dist-all + pom + Keycloak WAR Distribution + + + + + org.keycloak + keycloak-wildfly-adapter-dist + ${project.version} + zip + + + org.keycloak + keycloak-as7-adapter-dist + ${project.version} + zip + + + org.keycloak + keycloak-eap6-adapter-dist + ${project.version} + zip + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + + unpack + prepare-package + + unpack + + + + + org.keycloak + keycloak-war-deployment + ${project.version} + zip + ${project.build.directory}/unpacked + + + + org.keycloak + keycloak-examples-docs-dist + ${project.version} + zip + ${project.build.directory}/unpacked + + + + + + + + maven-assembly-plugin + 2.4 + + + assemble + package + + single + + + + assembly.xml + + + target + + + target/assembly/work + + false + + + + + + + + diff --git a/distribution/war-zip/assembly.xml b/distribution/war-zip/assembly.xml new file mode 100755 index 0000000000..89ed1aae8b --- /dev/null +++ b/distribution/war-zip/assembly.xml @@ -0,0 +1,23 @@ + + war-dist + + + zip + + false + + + + ${project.build.directory}/unpacked + + + + ${basedir} + + keycloak-ds.xml + auth-server.war.dodeploy + + deployments + + + diff --git a/distribution/war-zip/auth-server.war.dodeploy b/distribution/war-zip/auth-server.war.dodeploy new file mode 100755 index 0000000000..e69de29bb2 diff --git a/distribution/war-zip/keycloak-ds.xml b/distribution/war-zip/keycloak-ds.xml new file mode 100755 index 0000000000..a547c51809 --- /dev/null +++ b/distribution/war-zip/keycloak-ds.xml @@ -0,0 +1,11 @@ + + + + jdbc:h2:${jboss.server.data.dir}/keycloak;AUTO_SERVER=TRUE + h2 + + sa + sa + + + \ No newline at end of file diff --git a/distribution/war-zip/pom.xml b/distribution/war-zip/pom.xml new file mode 100755 index 0000000000..e6bb6f7423 --- /dev/null +++ b/distribution/war-zip/pom.xml @@ -0,0 +1,94 @@ + + 4.0.0 + + keycloak-parent + org.keycloak + 1.0-alpha-1-SNAPSHOT + ../../pom.xml + + + keycloak-war-deployment + pom + Keycloak WAR Deployment For Wildfly/AS7/EAP + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + + unpack + prepare-package + + unpack + + + + + org.keycloak + keycloak-server + ${project.version} + war + ${project.build.directory}/unpacked/deployments/auth-server.war + + + + + + + + com.google.code.maven-replacer-plugin + replacer + 1.5.2 + + + prepare-package + + replace + + + + + ${project.build.directory}/unpacked/deployments/auth-server.war/WEB-INF/classes/META-INF/persistence.xml + + + java:jboss/datasources/ExampleDS + java:jboss/datasources/KeycloakDS + + + + + + maven-assembly-plugin + 2.4 + + + assemble + package + + single + + + + assembly.xml + + + target + + + target/assembly/work + + false + + + + + + + + diff --git a/distribution/wildfly-adapter-zip/assembly.xml b/distribution/wildfly-adapter-zip/assembly.xml new file mode 100755 index 0000000000..b824efe3f5 --- /dev/null +++ b/distribution/wildfly-adapter-zip/assembly.xml @@ -0,0 +1,32 @@ + + war-dist + + + zip + + false + + + + ${project.build.directory}/unpacked + + org/keycloak/keycloak-as7-adapter/** + org/bouncycastle/** + + modules/system/layers/base + + + + diff --git a/distribution/wildfly-adapter-zip/pom.xml b/distribution/wildfly-adapter-zip/pom.xml new file mode 100755 index 0000000000..dad5a16df0 --- /dev/null +++ b/distribution/wildfly-adapter-zip/pom.xml @@ -0,0 +1,78 @@ + + 4.0.0 + + keycloak-parent + org.keycloak + 1.0-alpha-1-SNAPSHOT + ../../pom.xml + + + keycloak-wildfly-adapter-dist + pom + Keycloak Wildfly Adapter Distro + + + + + org.keycloak + keycloak-undertow-adapter + ${project.version} + zip + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + + unpack + prepare-package + + unpack + + + + + org.keycloak + keycloak-jboss-modules + ${project.version} + zip + ${project.build.directory}/unpacked + + + + + + + + maven-assembly-plugin + 2.4 + + + assemble + package + + single + + + + assembly.xml + + + target + + + target/assembly/work + + false + + + + + + + + diff --git a/examples/as7-eap-demo/README.md b/examples/as7-eap-demo/README.md index 0193e93536..49008c128b 100755 --- a/examples/as7-eap-demo/README.md +++ b/examples/as7-eap-demo/README.md @@ -1,15 +1,14 @@ -Login, Distributed SSO, Distributed Logout, and Oauth Token Grant AS7 Examples +Login, Distributed SSO, Distributed Logout, and Oauth Token Grant Wildfly Examples =================================== -The following examples requires JBoss AS7 or EAP 6.1, and Resteasy 3.0.2 and has been tested on version EAP 6.1. Here's the highlights of the examples +The following examples requires JBoss AS 7.1.1 or EAP 6.x. Here's the highlights of the examples * Delegating authentication of a web app to the remote authentication server via OAuth 2 protocols * Distributed Single-Sign-On and Single-Logout * Transferring identity and role mappings via a special bearer token (Skeleton Key Token). * Bearer token authentication and authorization of JAX-RS services * Obtaining bearer tokens via the OAuth2 protocol -There are 5 WAR projects. These all will run on the same jboss instance, but pretend each one is running on a different +There are multiple WAR projects. These all will run on the same jboss instance, but pretend each one is running on a different machine on the network or Internet. -* **auth-server**: This is the keycloak SSO auth server * **customer-app** A WAR applications that does remote login using OAUTH2 browser redirects with the auth server * **product-app** A WAR applications that does remote login using OAUTH2 browser redirects with the auth server * **database-service** JAX-RS services authenticated by bearer tokens only. The customer and product app invoke on it @@ -18,17 +17,45 @@ machine on the network or Internet. The UI of each of these applications is very crude and exists just to show our OAuth2 implementation in action. +_This demo is meant to run on the same server instance as the Keycloak Server!_ -Step 1: Make sure you've upgraded Resteasy + +Step 1: Make sure you've set up the Keycloak Server and Adapter -------------------------------------- -The first thing you is upgrade Resteasy to 3.0.4 within JBoss as described [here](http://docs.jboss.org/resteasy/docs/3.0.4.Final/userguide/html/Installation_Configuration.html#upgrading-as7) +Obtain latest keycloak-war-dist-all.zip. This distro is used to install keycloak onto an existing JBoss installation + +$ cd ${jboss.home}/standalone +$ cp -r ${keycloak-war-dist-all}/deployments . + +To install the adapter if running JBoss 7.1.1 +$ cd ${jboss.home} +$ unzip ${keycloak-war-dist-al}/adapters/keycloak-as7-adapter-dist.zip + +To install the adapter if running on EAP 6.x +$ cd ${jboss.home} +$ unzip ${keycloak-war-dist-all}/adapters/keycloak-as7-adapter-dist.zip -Step 2: Boot JBoss + +Step 2: Boot Keycloak Server --------------------------------------- -Boot JBoss in 'standalone' mode. +Where you go to start up the Keycloak Server depends on which distro you installed. -Step 3: Build and deploy +$ cd ${jboss.home}/bin +$ ./standalone.sh + +Step 3: Import the Test Realm +--------------------------------------- +Next thing you have to do is import the test realm for the demo. Clicking on the below link will bring you to the +create realm page in the admin UI. The username/password is admin/admin to login in. Keycloak will ask you to +create a new password admin password before you can go to the create realm page. + +[http://localhost:8080/auth-server/admin/index.html#/create/realm](http://localhost:8080/auth-server/admin/index.html#/create/realm) + +Import the testrealm.json file that is in the as7-eap6-demo/ example directory. + + +Step 4: Build and deploy --------------------------------------- next you must build and deploy @@ -36,7 +63,7 @@ next you must build and deploy 2. mvn clean install 3. mvn jboss-as:deploy -Step 4: Login and Observe Apps +Step 5: Login and Observe Apps --------------------------------------- Try going to the customer app and viewing customer data: @@ -49,7 +76,7 @@ are still happening, but the auth-server knows you are already logged in so the If you click on the logout link of either of the product or customer app, you'll be logged out of all the applications. -Step 5: Traditional OAuth2 Example +Step 6: Traditional OAuth2 Example ---------------------------------- The customer and product apps are logins. The third-party app is the traditional OAuth2 usecase of a client wanting to get permission to access a user's data. To run this example @@ -62,17 +89,11 @@ an oauth grant page. This page asks you if you want to grant certain permission Admin Console ========================== -1. Register or login - -You'll have to first register and create an account +1. Login Login: [http://localhost:8080/auth-server/rest/saas/login](http://localhost:8080/auth-server/rest/saas/login) -Register: -[http://localhost:8080/auth-server/rest/saas/registrations](http://localhost:8080/auth-server/rest/saas/registrations) - -2. Next you'll be brought to the admin console. Click "New Realm" button and start doing stuff. diff --git a/examples/as7-eap-demo/customer-app/pom.xml b/examples/as7-eap-demo/customer-app/pom.xml index 3fe1702680..2008eb84df 100755 --- a/examples/as7-eap-demo/customer-app/pom.xml +++ b/examples/as7-eap-demo/customer-app/pom.xml @@ -32,6 +32,7 @@ org.keycloak keycloak-as7-adapter ${project.version} + provided diff --git a/examples/as7-eap-demo/customer-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/examples/as7-eap-demo/customer-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml index c54e4abec6..e972711a03 100755 --- a/examples/as7-eap-demo/customer-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml +++ b/examples/as7-eap-demo/customer-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml @@ -1,7 +1,12 @@ - + + + + + \ No newline at end of file diff --git a/examples/as7-eap-demo/database-service/pom.xml b/examples/as7-eap-demo/database-service/pom.xml index fe9ea5ad64..ef834765b7 100755 --- a/examples/as7-eap-demo/database-service/pom.xml +++ b/examples/as7-eap-demo/database-service/pom.xml @@ -39,14 +39,15 @@ org.keycloak keycloak-as7-adapter ${project.version} + provided + + + org.apache.httpcomponents + httpclient + + + --> diff --git a/examples/as7-eap-demo/database-service/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/examples/as7-eap-demo/database-service/src/main/webapp/WEB-INF/jboss-deployment-structure.xml index c54e4abec6..8749019c0d 100755 --- a/examples/as7-eap-demo/database-service/src/main/webapp/WEB-INF/jboss-deployment-structure.xml +++ b/examples/as7-eap-demo/database-service/src/main/webapp/WEB-INF/jboss-deployment-structure.xml @@ -2,6 +2,8 @@ + + \ No newline at end of file diff --git a/examples/as7-eap-demo/pom.xml b/examples/as7-eap-demo/pom.xml index 916d24c9eb..dcd6d576c0 100755 --- a/examples/as7-eap-demo/pom.xml +++ b/examples/as7-eap-demo/pom.xml @@ -34,7 +34,6 @@ - server customer-app product-app database-service diff --git a/examples/as7-eap-demo/product-app/pom.xml b/examples/as7-eap-demo/product-app/pom.xml index 6e8bf03bc8..8d08c52596 100755 --- a/examples/as7-eap-demo/product-app/pom.xml +++ b/examples/as7-eap-demo/product-app/pom.xml @@ -32,6 +32,7 @@ org.keycloak keycloak-as7-adapter ${project.version} + provided diff --git a/examples/as7-eap-demo/product-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/examples/as7-eap-demo/product-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml index c54e4abec6..f8f12d36c0 100755 --- a/examples/as7-eap-demo/product-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml +++ b/examples/as7-eap-demo/product-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml @@ -2,6 +2,12 @@ + + + + + \ No newline at end of file diff --git a/examples/as7-eap-demo/server/pom.xml b/examples/as7-eap-demo/server/pom.xml deleted file mode 100755 index 5c468d57cd..0000000000 --- a/examples/as7-eap-demo/server/pom.xml +++ /dev/null @@ -1,189 +0,0 @@ - - - - keycloak-parent - org.keycloak - 1.0-alpha-1-SNAPSHOT - ../../../pom.xml - - 4.0.0 - org.keycloak.example.as7.demo - keycloak-server - war - Keycloak Demo - - - - - org.bouncycastle - bcprov-jdk16 - - - org.keycloak - keycloak-core - ${project.version} - - - org.keycloak - keycloak-core-jaxrs - ${project.version} - - - org.keycloak - keycloak-services - ${project.version} - - - org.keycloak - keycloak-model-api - ${project.version} - - - org.keycloak - keycloak-model-jpa - ${project.version} - - - org.keycloak - keycloak-social-core - ${project.version} - - - org.keycloak - keycloak-social-google - ${project.version} - - - org.keycloak - keycloak-social-twitter - ${project.version} - - - org.keycloak - keycloak-social-facebook - ${project.version} - - - org.keycloak - keycloak-forms - ${project.version} - - - org.keycloak - keycloak-admin-ui - ${project.version} - - - org.keycloak - keycloak-admin-ui-styles - ${project.version} - - - - com.h2database - h2 - - - org.mongodb - mongo-java-driver - - - de.flapdoodle.embed - de.flapdoodle.embed.mongo - - - junit - junit - 4.1 - test - - - org.jboss.spec.javax.servlet - jboss-servlet-api_3.0_spec - provided - - - - org.jboss.resteasy - resteasy-jaxrs - ${resteasy.version} - - - org.jboss.resteasy - resteasy-multipart-provider - ${resteasy.version} - - - org.jboss.resteasy - resteasy-client - ${resteasy.version} - - - org.jboss.resteasy - async-http-servlet-3.0 - ${resteasy.version} - - - org.jboss.resteasy - jaxrs-api - ${resteasy.version} - - - org.jboss.resteasy - resteasy-jackson-provider - ${resteasy.version} - - - - - auth-server - - - org.jboss.as.plugins - jboss-as-maven-plugin - 7.4.Final - - - org.apache.maven.plugins - maven-deploy-plugin - - true - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.6 - 1.6 - - - - - diff --git a/examples/as7-eap-demo/server/src/main/java/org/keycloak/example/demo/DemoApplication.java b/examples/as7-eap-demo/server/src/main/java/org/keycloak/example/demo/DemoApplication.java deleted file mode 100755 index df9af25a5e..0000000000 --- a/examples/as7-eap-demo/server/src/main/java/org/keycloak/example/demo/DemoApplication.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.keycloak.example.demo; - -import org.keycloak.models.KeycloakSession; -import org.keycloak.models.RealmModel; -import org.keycloak.representations.idm.RealmRepresentation; -import org.keycloak.services.managers.RealmManager; -import org.keycloak.services.resources.KeycloakApplication; -import org.keycloak.util.JsonSerialization; - -import javax.servlet.ServletContext; -import javax.ws.rs.core.Context; -import java.io.IOException; -import java.io.InputStream; -/** - * @author Bill Burke - * @version $Revision: 1 $ - */ -public class DemoApplication extends KeycloakApplication { - - public DemoApplication(@Context ServletContext servletContext) { - super(servletContext); - KeycloakSession session = factory.createSession(); - session.getTransaction().begin(); - install(new RealmManager(session)); - session.getTransaction().commit(); - } - - public void install(RealmManager manager) { - RealmRepresentation rep = loadJson("META-INF/testrealm.json"); - RealmModel realm = manager.createRealm("demo", rep.getRealm()); - manager.importRealm(rep, realm); - - } - - public static RealmRepresentation loadJson(String path) - { - InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(path); - try { - return JsonSerialization.readValue(is, RealmRepresentation.class); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - -} diff --git a/examples/as7-eap-demo/server/src/main/resources/META-INF/persistence.xml b/examples/as7-eap-demo/server/src/main/resources/META-INF/persistence.xml deleted file mode 100755 index b9497152f1..0000000000 --- a/examples/as7-eap-demo/server/src/main/resources/META-INF/persistence.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - java:jboss/datasources/ExampleDS - - org.keycloak.models.jpa.entities.ApplicationEntity - org.keycloak.models.jpa.entities.ApplicationScopeMappingEntity - org.keycloak.models.jpa.entities.ApplicationUserRoleMappingEntity - org.keycloak.models.jpa.entities.CredentialEntity - org.keycloak.models.jpa.entities.OAuthClientEntity - org.keycloak.models.jpa.entities.RealmEntity - org.keycloak.models.jpa.entities.RealmScopeMappingEntity - org.keycloak.models.jpa.entities.RealmUserRoleMappingEntity - org.keycloak.models.jpa.entities.RequiredCredentialEntity - org.keycloak.models.jpa.entities.RoleEntity - org.keycloak.models.jpa.entities.SocialLinkEntity - org.keycloak.models.jpa.entities.UserEntity - org.keycloak.models.jpa.entities.UserRoleMappingEntity - - true - - - - - - - - - diff --git a/examples/as7-eap-demo/server/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/examples/as7-eap-demo/server/src/main/webapp/WEB-INF/jboss-deployment-structure.xml deleted file mode 100755 index 2654f310d6..0000000000 --- a/examples/as7-eap-demo/server/src/main/webapp/WEB-INF/jboss-deployment-structure.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/examples/as7-eap-demo/server/src/main/webapp/WEB-INF/web.xml b/examples/as7-eap-demo/server/src/main/webapp/WEB-INF/web.xml deleted file mode 100755 index 5da97a9d43..0000000000 --- a/examples/as7-eap-demo/server/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - auth-server - - - Resteasy - org.jboss.resteasy.plugins.server.servlet.HttpServlet30Dispatcher - - javax.ws.rs.Application - org.keycloak.example.demo.DemoApplication - - - resteasy.servlet.mapping.prefix - /rest - - 1 - true - - - - org.keycloak.services.listeners.KeycloakSessionDestroyListener - - - - Keycloak Session Management - org.keycloak.services.filters.KeycloakSessionServletFilter - - - - Keycloak Session Management - /rest/* - - - - Resteasy - /rest/* - - - - - diff --git a/examples/as7-eap-demo/server/src/main/resources/META-INF/testrealm.json b/examples/as7-eap-demo/testrealm.json similarity index 100% rename from examples/as7-eap-demo/server/src/main/resources/META-INF/testrealm.json rename to examples/as7-eap-demo/testrealm.json diff --git a/examples/wildfly-demo/README.md b/examples/wildfly-demo/README.md index 0193e93536..48a4781c27 100755 --- a/examples/wildfly-demo/README.md +++ b/examples/wildfly-demo/README.md @@ -1,15 +1,14 @@ -Login, Distributed SSO, Distributed Logout, and Oauth Token Grant AS7 Examples +Login, Distributed SSO, Distributed Logout, and Oauth Token Grant Wildfly Examples =================================== -The following examples requires JBoss AS7 or EAP 6.1, and Resteasy 3.0.2 and has been tested on version EAP 6.1. Here's the highlights of the examples +The following examples requires Wildfly 8.0.0. Here's the highlights of the examples * Delegating authentication of a web app to the remote authentication server via OAuth 2 protocols * Distributed Single-Sign-On and Single-Logout * Transferring identity and role mappings via a special bearer token (Skeleton Key Token). * Bearer token authentication and authorization of JAX-RS services * Obtaining bearer tokens via the OAuth2 protocol -There are 5 WAR projects. These all will run on the same jboss instance, but pretend each one is running on a different +There are multiple WAR projects. These all will run on the same jboss instance, but pretend each one is running on a different machine on the network or Internet. -* **auth-server**: This is the keycloak SSO auth server * **customer-app** A WAR applications that does remote login using OAUTH2 browser redirects with the auth server * **product-app** A WAR applications that does remote login using OAUTH2 browser redirects with the auth server * **database-service** JAX-RS services authenticated by bearer tokens only. The customer and product app invoke on it @@ -18,25 +17,51 @@ machine on the network or Internet. The UI of each of these applications is very crude and exists just to show our OAuth2 implementation in action. +_This demo is meant to run on the same server instance as the Keycloak Server!_ -Step 1: Make sure you've upgraded Resteasy + +Step 1: Make sure you've set up the Keycloak Server -------------------------------------- -The first thing you is upgrade Resteasy to 3.0.4 within JBoss as described [here](http://docs.jboss.org/resteasy/docs/3.0.4.Final/userguide/html/Installation_Configuration.html#upgrading-as7) +If you've downloaded the Keycloak Appliance Distribution, there is already a Wildfly distro all set up for you. This +Wildfly distro has the adapter jboss modules all installed as well as the keycloak server all set up. +If you want to install Keycloak Server and run the demo on an existing Wildfly instance: -Step 2: Boot JBoss +Obtain latest keycloak-war-dist-all.zip. This distro is used to install keycloak onto an existing JBoss installation + +$ cd ${jboss.home}/standalone +$ cp -r ${keycloak-war-dist-all}/deployments . + +To install the adapter: +$ cd ${jboss.home} +$ unzip ${keycloak-war-dist-al}/adapters/keycloak-wildfly-adapter-dist.zip + +Step 2: Boot Keycloak Server --------------------------------------- -Boot JBoss in 'standalone' mode. +Where you go to start up the Keycloak Server depends on which distro you installed. -Step 3: Build and deploy +$ ./standalone.sh + +Step 3: Import the Test Realm +--------------------------------------- +Next thing you have to do is import the test realm for the demo. Clicking on the below link will bring you to the +create realm page in the admin UI. The username/password is admin/admin to login in. Keycloak will ask you to +create a new password admin password before you can go to the create realm page. + +[http://localhost:8080/auth-server/admin/index.html#/create/realm](http://localhost:8080/auth-server/admin/index.html#/create/realm) + +Import the testrealm.json file that is in the wildfly-demo/ example directory. + + +Step 4: Build and deploy --------------------------------------- next you must build and deploy -1. cd as7-eap-demo +1. cd wildfly-demo 2. mvn clean install 3. mvn jboss-as:deploy -Step 4: Login and Observe Apps +Step 5: Login and Observe Apps --------------------------------------- Try going to the customer app and viewing customer data: @@ -49,7 +74,7 @@ are still happening, but the auth-server knows you are already logged in so the If you click on the logout link of either of the product or customer app, you'll be logged out of all the applications. -Step 5: Traditional OAuth2 Example +Step 6: Traditional OAuth2 Example ---------------------------------- The customer and product apps are logins. The third-party app is the traditional OAuth2 usecase of a client wanting to get permission to access a user's data. To run this example @@ -62,17 +87,11 @@ an oauth grant page. This page asks you if you want to grant certain permission Admin Console ========================== -1. Register or login - -You'll have to first register and create an account +1. Login Login: [http://localhost:8080/auth-server/rest/saas/login](http://localhost:8080/auth-server/rest/saas/login) -Register: -[http://localhost:8080/auth-server/rest/saas/registrations](http://localhost:8080/auth-server/rest/saas/registrations) - -2. Next you'll be brought to the admin console. Click "New Realm" button and start doing stuff. diff --git a/examples/wildfly-demo/customer-app/pom.xml b/examples/wildfly-demo/customer-app/pom.xml index 3619e6c2e6..e01a111243 100755 --- a/examples/wildfly-demo/customer-app/pom.xml +++ b/examples/wildfly-demo/customer-app/pom.xml @@ -32,6 +32,7 @@ org.keycloak keycloak-undertow-adapter ${project.version} + provided diff --git a/examples/wildfly-demo/customer-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/examples/wildfly-demo/customer-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml index c54e4abec6..5cea82c04e 100755 --- a/examples/wildfly-demo/customer-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml +++ b/examples/wildfly-demo/customer-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml @@ -1,7 +1,12 @@ - + + + + + \ No newline at end of file diff --git a/examples/wildfly-demo/database-service/pom.xml b/examples/wildfly-demo/database-service/pom.xml index 5229b7dddf..339670da4a 100755 --- a/examples/wildfly-demo/database-service/pom.xml +++ b/examples/wildfly-demo/database-service/pom.xml @@ -39,6 +39,7 @@ org.keycloak keycloak-undertow-adapter ${project.version} + provided + + \ No newline at end of file diff --git a/examples/wildfly-demo/pom.xml b/examples/wildfly-demo/pom.xml index e170820bf7..1d86e9e532 100755 --- a/examples/wildfly-demo/pom.xml +++ b/examples/wildfly-demo/pom.xml @@ -34,7 +34,7 @@ - server + customer-app product-app database-service diff --git a/examples/wildfly-demo/product-app/pom.xml b/examples/wildfly-demo/product-app/pom.xml index 2830bc169e..d7a8a010f0 100755 --- a/examples/wildfly-demo/product-app/pom.xml +++ b/examples/wildfly-demo/product-app/pom.xml @@ -32,6 +32,7 @@ org.keycloak keycloak-undertow-adapter ${project.version} + provided diff --git a/examples/wildfly-demo/product-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/examples/wildfly-demo/product-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml index c54e4abec6..5cea82c04e 100755 --- a/examples/wildfly-demo/product-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml +++ b/examples/wildfly-demo/product-app/src/main/webapp/WEB-INF/jboss-deployment-structure.xml @@ -1,7 +1,12 @@ - + + + + + \ No newline at end of file diff --git a/examples/wildfly-demo/server/pom.xml b/examples/wildfly-demo/server/pom.xml deleted file mode 100755 index 2b4207d7d4..0000000000 --- a/examples/wildfly-demo/server/pom.xml +++ /dev/null @@ -1,189 +0,0 @@ - - - - keycloak-parent - org.keycloak - 1.0-alpha-1-SNAPSHOT - ../../../pom.xml - - 4.0.0 - org.keycloak.example.wildfly.demo - keycloak-server - war - Keycloak Demo - - - - - org.bouncycastle - bcprov-jdk16 - - - org.keycloak - keycloak-core - ${project.version} - - - org.keycloak - keycloak-core-jaxrs - ${project.version} - - - org.keycloak - keycloak-services - ${project.version} - - - org.keycloak - keycloak-model-api - ${project.version} - - - org.keycloak - keycloak-model-jpa - ${project.version} - - - org.keycloak - keycloak-social-core - ${project.version} - - - org.keycloak - keycloak-social-google - ${project.version} - - - org.keycloak - keycloak-social-twitter - ${project.version} - - - org.keycloak - keycloak-social-facebook - ${project.version} - - - org.keycloak - keycloak-forms - ${project.version} - - - org.keycloak - keycloak-admin-ui - ${project.version} - - - org.keycloak - keycloak-admin-ui-styles - ${project.version} - - - - com.h2database - h2 - - - org.mongodb - mongo-java-driver - - - de.flapdoodle.embed - de.flapdoodle.embed.mongo - - - junit - junit - 4.1 - test - - - org.jboss.spec.javax.servlet - jboss-servlet-api_3.0_spec - provided - - - - org.jboss.resteasy - resteasy-jaxrs - ${resteasy.version} - - - org.jboss.resteasy - resteasy-multipart-provider - ${resteasy.version} - - - org.jboss.resteasy - resteasy-client - ${resteasy.version} - - - org.jboss.resteasy - async-http-servlet-3.0 - ${resteasy.version} - - - org.jboss.resteasy - jaxrs-api - ${resteasy.version} - - - org.jboss.resteasy - resteasy-jackson-provider - ${resteasy.version} - - - - - auth-server - - - org.jboss.as.plugins - jboss-as-maven-plugin - 7.4.Final - - - org.apache.maven.plugins - maven-deploy-plugin - - true - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.6 - 1.6 - - - - - diff --git a/examples/wildfly-demo/server/src/main/java/org/keycloak/example/demo/DemoApplication.java b/examples/wildfly-demo/server/src/main/java/org/keycloak/example/demo/DemoApplication.java deleted file mode 100755 index df9af25a5e..0000000000 --- a/examples/wildfly-demo/server/src/main/java/org/keycloak/example/demo/DemoApplication.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.keycloak.example.demo; - -import org.keycloak.models.KeycloakSession; -import org.keycloak.models.RealmModel; -import org.keycloak.representations.idm.RealmRepresentation; -import org.keycloak.services.managers.RealmManager; -import org.keycloak.services.resources.KeycloakApplication; -import org.keycloak.util.JsonSerialization; - -import javax.servlet.ServletContext; -import javax.ws.rs.core.Context; -import java.io.IOException; -import java.io.InputStream; -/** - * @author Bill Burke - * @version $Revision: 1 $ - */ -public class DemoApplication extends KeycloakApplication { - - public DemoApplication(@Context ServletContext servletContext) { - super(servletContext); - KeycloakSession session = factory.createSession(); - session.getTransaction().begin(); - install(new RealmManager(session)); - session.getTransaction().commit(); - } - - public void install(RealmManager manager) { - RealmRepresentation rep = loadJson("META-INF/testrealm.json"); - RealmModel realm = manager.createRealm("demo", rep.getRealm()); - manager.importRealm(rep, realm); - - } - - public static RealmRepresentation loadJson(String path) - { - InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(path); - try { - return JsonSerialization.readValue(is, RealmRepresentation.class); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - -} diff --git a/examples/wildfly-demo/server/src/main/resources/META-INF/persistence.xml b/examples/wildfly-demo/server/src/main/resources/META-INF/persistence.xml deleted file mode 100755 index b9497152f1..0000000000 --- a/examples/wildfly-demo/server/src/main/resources/META-INF/persistence.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - java:jboss/datasources/ExampleDS - - org.keycloak.models.jpa.entities.ApplicationEntity - org.keycloak.models.jpa.entities.ApplicationScopeMappingEntity - org.keycloak.models.jpa.entities.ApplicationUserRoleMappingEntity - org.keycloak.models.jpa.entities.CredentialEntity - org.keycloak.models.jpa.entities.OAuthClientEntity - org.keycloak.models.jpa.entities.RealmEntity - org.keycloak.models.jpa.entities.RealmScopeMappingEntity - org.keycloak.models.jpa.entities.RealmUserRoleMappingEntity - org.keycloak.models.jpa.entities.RequiredCredentialEntity - org.keycloak.models.jpa.entities.RoleEntity - org.keycloak.models.jpa.entities.SocialLinkEntity - org.keycloak.models.jpa.entities.UserEntity - org.keycloak.models.jpa.entities.UserRoleMappingEntity - - true - - - - - - - - - diff --git a/examples/wildfly-demo/server/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/examples/wildfly-demo/server/src/main/webapp/WEB-INF/jboss-deployment-structure.xml deleted file mode 100755 index 07f3c5d212..0000000000 --- a/examples/wildfly-demo/server/src/main/webapp/WEB-INF/jboss-deployment-structure.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/examples/wildfly-demo/server/src/main/webapp/WEB-INF/web.xml b/examples/wildfly-demo/server/src/main/webapp/WEB-INF/web.xml deleted file mode 100755 index 5da97a9d43..0000000000 --- a/examples/wildfly-demo/server/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - auth-server - - - Resteasy - org.jboss.resteasy.plugins.server.servlet.HttpServlet30Dispatcher - - javax.ws.rs.Application - org.keycloak.example.demo.DemoApplication - - - resteasy.servlet.mapping.prefix - /rest - - 1 - true - - - - org.keycloak.services.listeners.KeycloakSessionDestroyListener - - - - Keycloak Session Management - org.keycloak.services.filters.KeycloakSessionServletFilter - - - - Keycloak Session Management - /rest/* - - - - Resteasy - /rest/* - - - - - diff --git a/examples/wildfly-demo/server/src/main/resources/META-INF/testrealm.json b/examples/wildfly-demo/testrealm.json similarity index 100% rename from examples/wildfly-demo/server/src/main/resources/META-INF/testrealm.json rename to examples/wildfly-demo/testrealm.json diff --git a/integration/adapter-core/pom.xml b/integration/adapter-core/pom.xml index 0c720d8b3e..5fef70c5a2 100755 --- a/integration/adapter-core/pom.xml +++ b/integration/adapter-core/pom.xml @@ -42,7 +42,7 @@ org.apache.httpcomponents httpclient - ${apache.httpcomponents.version} + ${keycloak.apache.httpcomponents.version} provided diff --git a/integration/as7-eap6/adapter/pom.xml b/integration/as7-eap6/adapter/pom.xml index 5e2b9d595f..8e350ffd99 100755 --- a/integration/as7-eap6/adapter/pom.xml +++ b/integration/as7-eap6/adapter/pom.xml @@ -13,12 +13,6 @@ - - org.jboss.logging - jboss-logging - 3.1.2.GA - provided - org.keycloak keycloak-core @@ -32,7 +26,7 @@ org.apache.httpcomponents httpclient - ${apache.httpcomponents.version} + ${keycloak.apache.httpcomponents.version} org.bouncycastle @@ -55,6 +49,12 @@ jboss-servlet-api_3.0_spec provided + + org.jboss.logging + jboss-logging + 3.1.2.GA + provided + org.jboss.web jbossweb diff --git a/integration/servlet-oauth-client/pom.xml b/integration/servlet-oauth-client/pom.xml index c41777c733..a17d3024b8 100755 --- a/integration/servlet-oauth-client/pom.xml +++ b/integration/servlet-oauth-client/pom.xml @@ -30,7 +30,7 @@ org.apache.httpcomponents httpclient - ${apache.httpcomponents.version} + ${keycloak.apache.httpcomponents.version} org.codehaus.jackson diff --git a/integration/undertow/pom.xml b/integration/undertow/pom.xml index 3cda86eea3..f652b8d367 100755 --- a/integration/undertow/pom.xml +++ b/integration/undertow/pom.xml @@ -32,7 +32,7 @@ org.apache.httpcomponents httpclient - ${apache.httpcomponents.version} + ${keycloak.apache.httpcomponents.version} org.bouncycastle diff --git a/pom.xml b/pom.xml index c4b697879c..80813f6c6a 100755 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ pom - 4.1.2 + 4.1.2 3.0.5.Final 1.0.0.Beta28 2.5.0.Beta6 @@ -25,7 +25,7 @@ 5.1.25 1.6.1 7.1.1.Final - 8.0.0.Beta1 + 8.0.0.CR1 http://keycloak.org @@ -86,8 +86,6 @@ examples testsuite server - dist - dist-as7 @@ -328,11 +326,11 @@ mysql-connector-java ${mysql.version} - diff --git a/server/pom.xml b/server/pom.xml index e58d026f5b..404d60ba0d 100755 --- a/server/pom.xml +++ b/server/pom.xml @@ -16,20 +16,19 @@ - org.keycloak - keycloak-admin-ui - ${project.version} - - - org.keycloak - keycloak-admin-ui-styles - ${project.version} + org.bouncycastle + bcprov-jdk16 org.keycloak keycloak-core ${project.version} + + org.keycloak + keycloak-core-jaxrs + ${project.version} + org.keycloak keycloak-services @@ -54,24 +53,6 @@ org.keycloak keycloak-social-google ${project.version} - - - org.apache.httpcomponents - httpclient - - - commons-logging - commons-logging - - - commons-codec - commons-codec - - - org.codehaus.jackson - jackson-core-asl - - org.keycloak @@ -89,49 +70,75 @@ ${project.version} - org.jboss.resteasy - jaxrs-api - provided + org.keycloak + keycloak-admin-ui + ${project.version} + + + org.keycloak + keycloak-admin-ui-styles + ${project.version} + + + junit + junit + 4.1 + test org.jboss.spec.javax.servlet jboss-servlet-api_3.0_spec provided - - org.codehaus.jackson - jackson-core-asl - provided - - - org.codehaus.jackson - jackson-mapper-asl - provided - + org.jboss.resteasy resteasy-jaxrs - provided - - - log4j - log4j - - - org.slf4j - slf4j-api - - - org.slf4j - slf4j-simple - - + ${resteasy.version} + + + org.jboss.resteasy + resteasy-multipart-provider + ${resteasy.version} + + + org.jboss.resteasy + resteasy-client + ${resteasy.version} + + + org.jboss.resteasy + async-http-servlet-3.0 + ${resteasy.version} + + + org.jboss.resteasy + jaxrs-api + ${resteasy.version} + + + org.jboss.resteasy + resteasy-jackson-provider + ${resteasy.version} auth-server + + org.jboss.as.plugins + jboss-as-maven-plugin + 7.5.Final + + + + org.apache.maven.plugins + maven-deploy-plugin + + true + + org.apache.maven.plugins maven-compiler-plugin diff --git a/server/src/main/resources/META-INF/jboss-deployment-structure.xml b/server/src/main/resources/META-INF/jboss-deployment-structure.xml deleted file mode 100644 index ad328f493c..0000000000 --- a/server/src/main/resources/META-INF/jboss-deployment-structure.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/server/src/main/resources/META-INF/persistence.xml b/server/src/main/resources/META-INF/persistence.xml index 89a3822fa8..d15233c86e 100755 --- a/server/src/main/resources/META-INF/persistence.xml +++ b/server/src/main/resources/META-INF/persistence.xml @@ -1,27 +1,27 @@ - - - java:jboss/datasources/KeycloakDS - org.keycloak.models.jpa.entities.ApplicationEntity - org.keycloak.models.jpa.entities.ApplicationScopeMappingEntity - org.keycloak.models.jpa.entities.ApplicationUserRoleMappingEntity - org.keycloak.models.jpa.entities.CredentialEntity - org.keycloak.models.jpa.entities.OAuthClientEntity - org.keycloak.models.jpa.entities.RealmEntity - org.keycloak.models.jpa.entities.RealmScopeMappingEntity - org.keycloak.models.jpa.entities.RealmUserRoleMappingEntity - org.keycloak.models.jpa.entities.RequiredCredentialEntity - org.keycloak.models.jpa.entities.RoleEntity - org.keycloak.models.jpa.entities.SocialLinkEntity - org.keycloak.models.jpa.entities.UserEntity - org.keycloak.models.jpa.entities.UserRoleMappingEntity - - true - - - - - - + + + java:jboss/datasources/ExampleDS + org.keycloak.models.jpa.entities.ApplicationEntity + org.keycloak.models.jpa.entities.ApplicationScopeMappingEntity + org.keycloak.models.jpa.entities.ApplicationUserRoleMappingEntity + org.keycloak.models.jpa.entities.CredentialEntity + org.keycloak.models.jpa.entities.OAuthClientEntity + org.keycloak.models.jpa.entities.RealmEntity + org.keycloak.models.jpa.entities.RealmScopeMappingEntity + org.keycloak.models.jpa.entities.RealmUserRoleMappingEntity + org.keycloak.models.jpa.entities.RequiredCredentialEntity + org.keycloak.models.jpa.entities.RoleEntity + org.keycloak.models.jpa.entities.SocialLinkEntity + org.keycloak.models.jpa.entities.UserEntity + org.keycloak.models.jpa.entities.UserRoleMappingEntity + + true + + + + + + diff --git a/server/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/server/src/main/webapp/WEB-INF/jboss-deployment-structure.xml index 8caa96f6a0..d4f4af997d 100755 --- a/server/src/main/webapp/WEB-INF/jboss-deployment-structure.xml +++ b/server/src/main/webapp/WEB-INF/jboss-deployment-structure.xml @@ -1,10 +1,21 @@ - - - - - - + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/server/src/main/webapp/WEB-INF/web.xml b/server/src/main/webapp/WEB-INF/web.xml index 6f04261da3..f800f47edd 100755 --- a/server/src/main/webapp/WEB-INF/web.xml +++ b/server/src/main/webapp/WEB-INF/web.xml @@ -44,4 +44,17 @@ /rest/* + + +