From e770a05db0be725888ba35f8a17fcdfc32be1369 Mon Sep 17 00:00:00 2001 From: Rene Ploetz Date: Mon, 6 Mar 2017 23:01:24 +0100 Subject: [PATCH] KEYCLOAK-4537 Jetty 9.4 implementation (OIDC/SAML) --- .../AbstractKeycloakJettyAuthenticator.java | 4 +- .../adapters/jetty/Jetty81SessionManager.java | 40 ++ .../jetty/KeycloakJettyAuthenticator.java | 6 + .../adapters/jetty/Jetty91SessionManager.java | 40 ++ .../jetty/KeycloakJettyAuthenticator.java | 6 + .../adapters/jetty/Jetty92SessionManager.java | 40 ++ .../jetty/KeycloakJettyAuthenticator.java | 6 + .../adapters/jetty/Jetty93SessionManager.java | 40 ++ .../jetty/KeycloakJettyAuthenticator.java | 6 + adapters/oidc/jetty/jetty9.4/pom.xml | 156 ++++++ .../jetty/Jetty94RequestAuthenticator.java | 47 ++ .../adapters/jetty/Jetty94SessionManager.java | 40 ++ .../jetty/JettyAdapterSessionStore.java | 111 +++++ .../jetty/KeycloakJettyAuthenticator.java | 75 +++ adapters/oidc/jetty/pom.xml | 1 + .../saml/jetty/AbstractSamlAuthenticator.java | 4 +- .../saml/jetty/Jetty8SessionManager.java | 40 ++ .../saml/jetty/KeycloakSamlAuthenticator.java | 6 + .../saml/jetty/Jetty9SessionManager.java | 40 ++ .../saml/jetty/KeycloakSamlAuthenticator.java | 7 +- .../saml/jetty/Jetty9SessionManager.java | 40 ++ .../saml/jetty/KeycloakSamlAuthenticator.java | 7 +- .../saml/jetty/Jetty9SessionManager.java | 40 ++ .../saml/jetty/KeycloakSamlAuthenticator.java | 7 +- adapters/saml/jetty/jetty9.4/pom.xml | 162 +++++++ .../saml/jetty/Jetty9SamlSessionStore.java | 44 ++ .../saml/jetty/Jetty9SessionManager.java | 40 ++ .../saml/jetty/JettyAdapterSessionStore.java | 111 +++++ .../saml/jetty/KeycloakSamlAuthenticator.java | 72 +++ adapters/saml/jetty/pom.xml | 1 + .../jetty/spi/JettySessionManager.java | 28 ++ .../jetty/spi/JettyUserSessionManagement.java | 5 +- .../adapters/jetty94-adapter-zip/assembly.xml | 56 +++ .../adapters/jetty94-adapter-zip/keycloak.mod | 28 ++ .../adapters/jetty94-adapter-zip/pom.xml | 68 +++ distribution/adapters/pom.xml | 1 + .../downloads/src/main/resources/files | 2 + .../jetty94-adapter-zip/assembly.xml | 56 +++ .../jetty94-adapter-zip/keycloak.mod | 28 ++ .../saml-adapters/jetty94-adapter-zip/pom.xml | 68 +++ distribution/saml-adapters/pom.xml | 1 + pom.xml | 22 + testsuite/jetty/jetty94/pom.xml | 427 +++++++++++++++++ .../org/keycloak/testsuite/Jetty9Test.java | 197 ++++++++ .../org/keycloak/testsuite/JettySamlTest.java | 204 ++++++++ .../WEB-INF/jetty-web.xml | 46 ++ .../WEB-INF/keycloak.json | 10 + .../customer-db-error-page/WEB-INF/web.xml | 96 ++++ .../customer-db/WEB-INF/jetty-web.xml | 46 ++ .../customer-db/WEB-INF/keycloak.json | 10 + .../adapter-test/customer-db/WEB-INF/web.xml | 57 +++ .../customer-portal/WEB-INF/jetty-web.xml | 46 ++ .../customer-portal/WEB-INF/keycloak.json | 11 + .../customer-portal/WEB-INF/web.xml | 76 +++ .../resources/adapter-test/demorealm.json | 164 +++++++ .../input-portal/WEB-INF/jetty-web.xml | 46 ++ .../input-portal/WEB-INF/keycloak.json | 10 + .../adapter-test/input-portal/WEB-INF/web.xml | 57 +++ .../product-portal/WEB-INF/jetty-web.xml | 46 ++ .../product-portal/WEB-INF/keycloak.json | 10 + .../product-portal/WEB-INF/web.xml | 57 +++ .../secure-portal/WEB-INF/jetty-web.xml | 46 ++ .../secure-portal/WEB-INF/keycloak.json | 10 + .../secure-portal/WEB-INF/web.xml | 47 ++ .../session-portal/WEB-INF/jetty-web.xml | 46 ++ .../session-portal/WEB-INF/keycloak.json | 10 + .../session-portal/WEB-INF/web.xml | 57 +++ .../WEB-INF/jetty-web.xml | 46 ++ .../WEB-INF/keycloak-saml.xml | 64 +++ .../WEB-INF/keystore.jks | Bin 0 -> 1739 bytes .../bad-client-signed-post/WEB-INF/web.xml | 60 +++ .../WEB-INF/jetty-web.xml | 46 ++ .../WEB-INF/keycloak-saml.xml | 64 +++ .../WEB-INF/keystore.jks | Bin 0 -> 1715 bytes .../bad-realm-signed-post/WEB-INF/web.xml | 88 ++++ .../encrypted-post/WEB-INF/jetty-web.xml | 46 ++ .../encrypted-post/WEB-INF/keycloak-saml.xml | 64 +++ .../encrypted-post/WEB-INF/keystore.jks | Bin 0 -> 1707 bytes .../encrypted-post/WEB-INF/web.xml | 60 +++ .../mappers/WEB-INF/jetty-web.xml | 46 ++ .../mappers/WEB-INF/keycloak-saml.xml | 44 ++ .../keycloak-saml/mappers/WEB-INF/web.xml | 73 +++ .../signed-front-get/WEB-INF/jetty-web.xml | 46 ++ .../WEB-INF/keycloak-saml.xml | 63 +++ .../signed-front-get/WEB-INF/keystore.jks | Bin 0 -> 1701 bytes .../signed-front-get/WEB-INF/web.xml | 60 +++ .../signed-get/WEB-INF/jetty-web.xml | 46 ++ .../signed-get/WEB-INF/keycloak-saml.xml | 63 +++ .../signed-get/WEB-INF/keystore.jks | Bin 0 -> 1701 bytes .../keycloak-saml/signed-get/WEB-INF/web.xml | 88 ++++ .../signed-metadata/WEB-INF/jetty-web.xml | 46 ++ .../signed-metadata/WEB-INF/keycloak-saml.xml | 64 +++ .../signed-metadata/WEB-INF/keystore.jks | Bin 0 -> 1705 bytes .../signed-metadata/WEB-INF/web.xml | 60 +++ .../signed-post-email/WEB-INF/jetty-web.xml | 46 ++ .../WEB-INF/keycloak-saml.xml | 63 +++ .../signed-post-email/WEB-INF/keystore.jks | Bin 0 -> 1705 bytes .../signed-post-email/WEB-INF/web.xml | 60 +++ .../WEB-INF/jetty-web.xml | 46 ++ .../WEB-INF/keycloak-saml.xml | 64 +++ .../WEB-INF/keystore.jks | Bin 0 -> 1705 bytes .../signed-post-persistent/WEB-INF/web.xml | 60 +++ .../WEB-INF/jetty-web.xml | 46 ++ .../WEB-INF/keycloak-saml.xml | 64 +++ .../WEB-INF/keystore.jks | Bin 0 -> 1705 bytes .../signed-post-transient/WEB-INF/web.xml | 60 +++ .../signed-post/WEB-INF/jetty-web.xml | 46 ++ .../signed-post/WEB-INF/keycloak-saml.xml | 64 +++ .../signed-post/WEB-INF/keystore.jks | Bin 0 -> 1705 bytes .../keycloak-saml/signed-post/WEB-INF/web.xml | 60 +++ .../simple-input/WEB-INF/jetty-web.xml | 46 ++ .../simple-input/WEB-INF/keycloak-saml.xml | 43 ++ .../simple-input/WEB-INF/web.xml | 60 +++ .../simple-post/WEB-INF/jetty-web.xml | 46 ++ .../simple-post/WEB-INF/keycloak-saml.xml | 43 ++ .../keycloak-saml/simple-post/WEB-INF/web.xml | 60 +++ .../simple-post2/WEB-INF/jetty-web.xml | 46 ++ .../simple-post2/WEB-INF/keycloak-saml.xml | 43 ++ .../simple-post2/WEB-INF/web.xml | 60 +++ .../resources/keycloak-saml/sp-metadata.xml | 55 +++ .../resources/keycloak-saml/testsaml.json | 452 ++++++++++++++++++ testsuite/jetty/pom.xml | 1 + 122 files changed, 6297 insertions(+), 8 deletions(-) create mode 100755 adapters/oidc/jetty/jetty8.1/src/main/java/org/keycloak/adapters/jetty/Jetty81SessionManager.java create mode 100755 adapters/oidc/jetty/jetty9.1/src/main/java/org/keycloak/adapters/jetty/Jetty91SessionManager.java create mode 100755 adapters/oidc/jetty/jetty9.2/src/main/java/org/keycloak/adapters/jetty/Jetty92SessionManager.java create mode 100755 adapters/oidc/jetty/jetty9.3/src/main/java/org/keycloak/adapters/jetty/Jetty93SessionManager.java create mode 100644 adapters/oidc/jetty/jetty9.4/pom.xml create mode 100644 adapters/oidc/jetty/jetty9.4/src/main/java/org/keycloak/adapters/jetty/Jetty94RequestAuthenticator.java create mode 100755 adapters/oidc/jetty/jetty9.4/src/main/java/org/keycloak/adapters/jetty/Jetty94SessionManager.java create mode 100644 adapters/oidc/jetty/jetty9.4/src/main/java/org/keycloak/adapters/jetty/JettyAdapterSessionStore.java create mode 100644 adapters/oidc/jetty/jetty9.4/src/main/java/org/keycloak/adapters/jetty/KeycloakJettyAuthenticator.java create mode 100755 adapters/saml/jetty/jetty8.1/src/main/java/org/keycloak/adapters/saml/jetty/Jetty8SessionManager.java create mode 100755 adapters/saml/jetty/jetty9.1/src/main/java/org/keycloak/adapters/saml/jetty/Jetty9SessionManager.java create mode 100755 adapters/saml/jetty/jetty9.2/src/main/java/org/keycloak/adapters/saml/jetty/Jetty9SessionManager.java create mode 100755 adapters/saml/jetty/jetty9.3/src/main/java/org/keycloak/adapters/saml/jetty/Jetty9SessionManager.java create mode 100644 adapters/saml/jetty/jetty9.4/pom.xml create mode 100644 adapters/saml/jetty/jetty9.4/src/main/java/org/keycloak/adapters/saml/jetty/Jetty9SamlSessionStore.java create mode 100755 adapters/saml/jetty/jetty9.4/src/main/java/org/keycloak/adapters/saml/jetty/Jetty9SessionManager.java create mode 100644 adapters/saml/jetty/jetty9.4/src/main/java/org/keycloak/adapters/saml/jetty/JettyAdapterSessionStore.java create mode 100644 adapters/saml/jetty/jetty9.4/src/main/java/org/keycloak/adapters/saml/jetty/KeycloakSamlAuthenticator.java create mode 100644 adapters/spi/jetty-adapter-spi/src/main/java/org/keycloak/adapters/jetty/spi/JettySessionManager.java create mode 100644 distribution/adapters/jetty94-adapter-zip/assembly.xml create mode 100644 distribution/adapters/jetty94-adapter-zip/keycloak.mod create mode 100644 distribution/adapters/jetty94-adapter-zip/pom.xml create mode 100644 distribution/saml-adapters/jetty94-adapter-zip/assembly.xml create mode 100644 distribution/saml-adapters/jetty94-adapter-zip/keycloak.mod create mode 100644 distribution/saml-adapters/jetty94-adapter-zip/pom.xml create mode 100644 testsuite/jetty/jetty94/pom.xml create mode 100644 testsuite/jetty/jetty94/src/test/java/org/keycloak/testsuite/Jetty9Test.java create mode 100644 testsuite/jetty/jetty94/src/test/java/org/keycloak/testsuite/JettySamlTest.java create mode 100644 testsuite/jetty/jetty94/src/test/resources/adapter-test/customer-db-error-page/WEB-INF/jetty-web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/adapter-test/customer-db-error-page/WEB-INF/keycloak.json create mode 100644 testsuite/jetty/jetty94/src/test/resources/adapter-test/customer-db-error-page/WEB-INF/web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/adapter-test/customer-db/WEB-INF/jetty-web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/adapter-test/customer-db/WEB-INF/keycloak.json create mode 100644 testsuite/jetty/jetty94/src/test/resources/adapter-test/customer-db/WEB-INF/web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/adapter-test/customer-portal/WEB-INF/jetty-web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/adapter-test/customer-portal/WEB-INF/keycloak.json create mode 100644 testsuite/jetty/jetty94/src/test/resources/adapter-test/customer-portal/WEB-INF/web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/adapter-test/demorealm.json create mode 100644 testsuite/jetty/jetty94/src/test/resources/adapter-test/input-portal/WEB-INF/jetty-web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/adapter-test/input-portal/WEB-INF/keycloak.json create mode 100644 testsuite/jetty/jetty94/src/test/resources/adapter-test/input-portal/WEB-INF/web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/adapter-test/product-portal/WEB-INF/jetty-web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/adapter-test/product-portal/WEB-INF/keycloak.json create mode 100644 testsuite/jetty/jetty94/src/test/resources/adapter-test/product-portal/WEB-INF/web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/adapter-test/secure-portal/WEB-INF/jetty-web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/adapter-test/secure-portal/WEB-INF/keycloak.json create mode 100644 testsuite/jetty/jetty94/src/test/resources/adapter-test/secure-portal/WEB-INF/web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/adapter-test/session-portal/WEB-INF/jetty-web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/adapter-test/session-portal/WEB-INF/keycloak.json create mode 100644 testsuite/jetty/jetty94/src/test/resources/adapter-test/session-portal/WEB-INF/web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/bad-client-signed-post/WEB-INF/jetty-web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/bad-client-signed-post/WEB-INF/keycloak-saml.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/bad-client-signed-post/WEB-INF/keystore.jks create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/bad-client-signed-post/WEB-INF/web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/bad-realm-signed-post/WEB-INF/jetty-web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/bad-realm-signed-post/WEB-INF/keycloak-saml.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/bad-realm-signed-post/WEB-INF/keystore.jks create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/bad-realm-signed-post/WEB-INF/web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/encrypted-post/WEB-INF/jetty-web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/encrypted-post/WEB-INF/keycloak-saml.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/encrypted-post/WEB-INF/keystore.jks create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/encrypted-post/WEB-INF/web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/mappers/WEB-INF/jetty-web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/mappers/WEB-INF/keycloak-saml.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/mappers/WEB-INF/web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-front-get/WEB-INF/jetty-web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-front-get/WEB-INF/keycloak-saml.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-front-get/WEB-INF/keystore.jks create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-front-get/WEB-INF/web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-get/WEB-INF/jetty-web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-get/WEB-INF/keycloak-saml.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-get/WEB-INF/keystore.jks create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-get/WEB-INF/web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-metadata/WEB-INF/jetty-web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-metadata/WEB-INF/keycloak-saml.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-metadata/WEB-INF/keystore.jks create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-metadata/WEB-INF/web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-email/WEB-INF/jetty-web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-email/WEB-INF/keycloak-saml.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-email/WEB-INF/keystore.jks create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-email/WEB-INF/web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-persistent/WEB-INF/jetty-web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-persistent/WEB-INF/keycloak-saml.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-persistent/WEB-INF/keystore.jks create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-persistent/WEB-INF/web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-transient/WEB-INF/jetty-web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-transient/WEB-INF/keycloak-saml.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-transient/WEB-INF/keystore.jks create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-transient/WEB-INF/web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post/WEB-INF/jetty-web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post/WEB-INF/keycloak-saml.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post/WEB-INF/keystore.jks create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post/WEB-INF/web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/simple-input/WEB-INF/jetty-web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/simple-input/WEB-INF/keycloak-saml.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/simple-input/WEB-INF/web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/simple-post/WEB-INF/jetty-web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/simple-post/WEB-INF/keycloak-saml.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/simple-post/WEB-INF/web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/simple-post2/WEB-INF/jetty-web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/simple-post2/WEB-INF/keycloak-saml.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/simple-post2/WEB-INF/web.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/sp-metadata.xml create mode 100644 testsuite/jetty/jetty94/src/test/resources/keycloak-saml/testsaml.json diff --git a/adapters/oidc/jetty/jetty-core/src/main/java/org/keycloak/adapters/jetty/core/AbstractKeycloakJettyAuthenticator.java b/adapters/oidc/jetty/jetty-core/src/main/java/org/keycloak/adapters/jetty/core/AbstractKeycloakJettyAuthenticator.java index ee41c0d209..4c3e5de1d3 100755 --- a/adapters/oidc/jetty/jetty-core/src/main/java/org/keycloak/adapters/jetty/core/AbstractKeycloakJettyAuthenticator.java +++ b/adapters/oidc/jetty/jetty-core/src/main/java/org/keycloak/adapters/jetty/core/AbstractKeycloakJettyAuthenticator.java @@ -106,6 +106,8 @@ public abstract class AbstractKeycloakJettyAuthenticator extends LoginAuthentica public abstract AdapterTokenStore createSessionTokenStore(Request request, KeycloakDeployment resolvedDeployment); + public abstract JettyUserSessionManagement createSessionManagement(Request request); + public void logoutCurrent(Request request) { AdapterDeploymentContext deploymentContext = (AdapterDeploymentContext) request.getAttribute(AdapterDeploymentContext.class.getName()); KeycloakSecurityContext ksc = (KeycloakSecurityContext) request.getAttribute(KeycloakSecurityContext.class.getName()); @@ -287,7 +289,7 @@ public abstract class AbstractKeycloakJettyAuthenticator extends LoginAuthentica log.debug("*** deployment isn't configured return false"); return Authentication.UNAUTHENTICATED; } - PreAuthActionsHandler handler = new PreAuthActionsHandler(new JettyUserSessionManagement(request.getSessionManager()), deploymentContext, facade); + PreAuthActionsHandler handler = new PreAuthActionsHandler(createSessionManagement(request), deploymentContext, facade); if (handler.handleRequest()) { return Authentication.SEND_SUCCESS; } diff --git a/adapters/oidc/jetty/jetty8.1/src/main/java/org/keycloak/adapters/jetty/Jetty81SessionManager.java b/adapters/oidc/jetty/jetty8.1/src/main/java/org/keycloak/adapters/jetty/Jetty81SessionManager.java new file mode 100755 index 0000000000..1f71df1b53 --- /dev/null +++ b/adapters/oidc/jetty/jetty8.1/src/main/java/org/keycloak/adapters/jetty/Jetty81SessionManager.java @@ -0,0 +1,40 @@ +/* + * Copyright 2016 Red Hat, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. + * + * 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. + */ + +package org.keycloak.adapters.jetty; + +import org.eclipse.jetty.server.SessionManager; +import org.keycloak.adapters.jetty.spi.JettySessionManager; + +import javax.servlet.http.HttpSession; + +/** + * @author Bill Burke + * @version $Revision: 1 $ + */ +public class Jetty81SessionManager implements JettySessionManager { + protected SessionManager sessionManager; + + public Jetty81SessionManager(SessionManager sessionManager) { + this.sessionManager = sessionManager; + } + + @Override + public HttpSession getHttpSession(String id) { + return sessionManager.getHttpSession(id); + } +} diff --git a/adapters/oidc/jetty/jetty8.1/src/main/java/org/keycloak/adapters/jetty/KeycloakJettyAuthenticator.java b/adapters/oidc/jetty/jetty8.1/src/main/java/org/keycloak/adapters/jetty/KeycloakJettyAuthenticator.java index 681f775231..2130cea224 100755 --- a/adapters/oidc/jetty/jetty8.1/src/main/java/org/keycloak/adapters/jetty/KeycloakJettyAuthenticator.java +++ b/adapters/oidc/jetty/jetty8.1/src/main/java/org/keycloak/adapters/jetty/KeycloakJettyAuthenticator.java @@ -25,6 +25,7 @@ import org.keycloak.adapters.AdapterTokenStore; import org.keycloak.adapters.KeycloakDeployment; import org.keycloak.adapters.jetty.core.AbstractKeycloakJettyAuthenticator; import org.keycloak.adapters.jetty.core.JettySessionTokenStore; +import org.keycloak.adapters.jetty.spi.JettyUserSessionManagement; import javax.servlet.ServletRequest; @@ -44,6 +45,11 @@ public class KeycloakJettyAuthenticator extends AbstractKeycloakJettyAuthenticat return new JettySessionTokenStore(request, resolvedDeployment, new JettyAdapterSessionStore(request)); } + @Override + public JettyUserSessionManagement createSessionManagement(Request request) { + return new JettyUserSessionManagement(new Jetty81SessionManager(request.getSessionManager())); + } + @Override protected Request resolveRequest(ServletRequest req) { return (req instanceof Request)?(Request)req: AbstractHttpConnection.getCurrentConnection().getRequest(); diff --git a/adapters/oidc/jetty/jetty9.1/src/main/java/org/keycloak/adapters/jetty/Jetty91SessionManager.java b/adapters/oidc/jetty/jetty9.1/src/main/java/org/keycloak/adapters/jetty/Jetty91SessionManager.java new file mode 100755 index 0000000000..d0df0a134c --- /dev/null +++ b/adapters/oidc/jetty/jetty9.1/src/main/java/org/keycloak/adapters/jetty/Jetty91SessionManager.java @@ -0,0 +1,40 @@ +/* + * Copyright 2016 Red Hat, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. + * + * 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. + */ + +package org.keycloak.adapters.jetty; + +import org.eclipse.jetty.server.SessionManager; +import org.keycloak.adapters.jetty.spi.JettySessionManager; + +import javax.servlet.http.HttpSession; + +/** + * @author Bill Burke + * @version $Revision: 1 $ + */ +public class Jetty91SessionManager implements JettySessionManager { + protected SessionManager sessionManager; + + public Jetty91SessionManager(SessionManager sessionManager) { + this.sessionManager = sessionManager; + } + + @Override + public HttpSession getHttpSession(String id) { + return sessionManager.getHttpSession(id); + } +} diff --git a/adapters/oidc/jetty/jetty9.1/src/main/java/org/keycloak/adapters/jetty/KeycloakJettyAuthenticator.java b/adapters/oidc/jetty/jetty9.1/src/main/java/org/keycloak/adapters/jetty/KeycloakJettyAuthenticator.java index 0df8e73512..c08f91fdda 100755 --- a/adapters/oidc/jetty/jetty9.1/src/main/java/org/keycloak/adapters/jetty/KeycloakJettyAuthenticator.java +++ b/adapters/oidc/jetty/jetty9.1/src/main/java/org/keycloak/adapters/jetty/KeycloakJettyAuthenticator.java @@ -27,6 +27,7 @@ import org.keycloak.adapters.jetty.core.AbstractKeycloakJettyAuthenticator; import org.keycloak.adapters.jetty.core.JettyRequestAuthenticator; import org.keycloak.adapters.jetty.core.JettySessionTokenStore; import org.keycloak.adapters.jetty.spi.JettyHttpFacade; +import org.keycloak.adapters.jetty.spi.JettyUserSessionManagement; import javax.servlet.ServletRequest; @@ -46,6 +47,11 @@ public class KeycloakJettyAuthenticator extends AbstractKeycloakJettyAuthenticat return new JettySessionTokenStore(request, resolvedDeployment, new JettyAdapterSessionStore(request)); } + @Override + public JettyUserSessionManagement createSessionManagement(Request request) { + return new JettyUserSessionManagement(new Jetty91SessionManager(request.getSessionManager())); + } + @Override protected Request resolveRequest(ServletRequest req) { return (req instanceof Request) ? (Request)req : HttpChannel.getCurrentHttpChannel().getRequest(); diff --git a/adapters/oidc/jetty/jetty9.2/src/main/java/org/keycloak/adapters/jetty/Jetty92SessionManager.java b/adapters/oidc/jetty/jetty9.2/src/main/java/org/keycloak/adapters/jetty/Jetty92SessionManager.java new file mode 100755 index 0000000000..455e06ab2e --- /dev/null +++ b/adapters/oidc/jetty/jetty9.2/src/main/java/org/keycloak/adapters/jetty/Jetty92SessionManager.java @@ -0,0 +1,40 @@ +/* + * Copyright 2016 Red Hat, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. + * + * 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. + */ + +package org.keycloak.adapters.jetty; + +import org.eclipse.jetty.server.SessionManager; +import org.keycloak.adapters.jetty.spi.JettySessionManager; + +import javax.servlet.http.HttpSession; + +/** + * @author Bill Burke + * @version $Revision: 1 $ + */ +public class Jetty92SessionManager implements JettySessionManager { + protected SessionManager sessionManager; + + public Jetty92SessionManager(SessionManager sessionManager) { + this.sessionManager = sessionManager; + } + + @Override + public HttpSession getHttpSession(String id) { + return sessionManager.getHttpSession(id); + } +} diff --git a/adapters/oidc/jetty/jetty9.2/src/main/java/org/keycloak/adapters/jetty/KeycloakJettyAuthenticator.java b/adapters/oidc/jetty/jetty9.2/src/main/java/org/keycloak/adapters/jetty/KeycloakJettyAuthenticator.java index 33884830d5..23aa9fb301 100755 --- a/adapters/oidc/jetty/jetty9.2/src/main/java/org/keycloak/adapters/jetty/KeycloakJettyAuthenticator.java +++ b/adapters/oidc/jetty/jetty9.2/src/main/java/org/keycloak/adapters/jetty/KeycloakJettyAuthenticator.java @@ -27,6 +27,7 @@ import org.keycloak.adapters.jetty.core.AbstractKeycloakJettyAuthenticator; import org.keycloak.adapters.jetty.core.JettyRequestAuthenticator; import org.keycloak.adapters.jetty.core.JettySessionTokenStore; import org.keycloak.adapters.jetty.spi.JettyHttpFacade; +import org.keycloak.adapters.jetty.spi.JettyUserSessionManagement; import javax.servlet.ServletRequest; @@ -61,6 +62,11 @@ public class KeycloakJettyAuthenticator extends AbstractKeycloakJettyAuthenticat return new JettySessionTokenStore(request, resolvedDeployment, new JettyAdapterSessionStore(request)); } + @Override + public JettyUserSessionManagement createSessionManagement(Request request) { + return new JettyUserSessionManagement(new Jetty92SessionManager(request.getSessionManager())); + } + @Override protected JettyRequestAuthenticator createRequestAuthenticator(Request request, JettyHttpFacade facade, KeycloakDeployment deployment, AdapterTokenStore tokenStore) { diff --git a/adapters/oidc/jetty/jetty9.3/src/main/java/org/keycloak/adapters/jetty/Jetty93SessionManager.java b/adapters/oidc/jetty/jetty9.3/src/main/java/org/keycloak/adapters/jetty/Jetty93SessionManager.java new file mode 100755 index 0000000000..da60c1157c --- /dev/null +++ b/adapters/oidc/jetty/jetty9.3/src/main/java/org/keycloak/adapters/jetty/Jetty93SessionManager.java @@ -0,0 +1,40 @@ +/* + * Copyright 2016 Red Hat, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. + * + * 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. + */ + +package org.keycloak.adapters.jetty; + +import org.eclipse.jetty.server.SessionManager; +import org.keycloak.adapters.jetty.spi.JettySessionManager; + +import javax.servlet.http.HttpSession; + +/** + * @author Bill Burke + * @version $Revision: 1 $ + */ +public class Jetty93SessionManager implements JettySessionManager { + protected SessionManager sessionManager; + + public Jetty93SessionManager(SessionManager sessionManager) { + this.sessionManager = sessionManager; + } + + @Override + public HttpSession getHttpSession(String id) { + return sessionManager.getHttpSession(id); + } +} diff --git a/adapters/oidc/jetty/jetty9.3/src/main/java/org/keycloak/adapters/jetty/KeycloakJettyAuthenticator.java b/adapters/oidc/jetty/jetty9.3/src/main/java/org/keycloak/adapters/jetty/KeycloakJettyAuthenticator.java index fe9c098d38..0285cd8d2c 100644 --- a/adapters/oidc/jetty/jetty9.3/src/main/java/org/keycloak/adapters/jetty/KeycloakJettyAuthenticator.java +++ b/adapters/oidc/jetty/jetty9.3/src/main/java/org/keycloak/adapters/jetty/KeycloakJettyAuthenticator.java @@ -26,6 +26,7 @@ import org.keycloak.adapters.jetty.core.AbstractKeycloakJettyAuthenticator; import org.keycloak.adapters.jetty.core.JettyRequestAuthenticator; import org.keycloak.adapters.jetty.core.JettySessionTokenStore; import org.keycloak.adapters.jetty.spi.JettyHttpFacade; +import org.keycloak.adapters.jetty.spi.JettyUserSessionManagement; import javax.servlet.ServletRequest; @@ -60,6 +61,11 @@ public class KeycloakJettyAuthenticator extends AbstractKeycloakJettyAuthenticat return new JettySessionTokenStore(request, resolvedDeployment, new JettyAdapterSessionStore(request)); } + @Override + public JettyUserSessionManagement createSessionManagement(Request request) { + return new JettyUserSessionManagement(new Jetty93SessionManager(request.getSessionManager())); + } + @Override protected JettyRequestAuthenticator createRequestAuthenticator(Request request, JettyHttpFacade facade, KeycloakDeployment deployment, AdapterTokenStore tokenStore) { diff --git a/adapters/oidc/jetty/jetty9.4/pom.xml b/adapters/oidc/jetty/jetty9.4/pom.xml new file mode 100644 index 0000000000..1f715fd4df --- /dev/null +++ b/adapters/oidc/jetty/jetty9.4/pom.xml @@ -0,0 +1,156 @@ + + + + + + keycloak-parent + org.keycloak + 3.0.0.CR1-SNAPSHOT + ../../../../pom.xml + + 4.0.0 + + keycloak-jetty94-adapter + Keycloak Jetty 9.4.x Integration + + 9.4.2.v20170220 + + org.keycloak.adapters.jetty.* + + + org.eclipse.jetty.*;resolution:=optional, + javax.servlet.*;version="[3.0,4)";resolution:=optional, + org.keycloak.*;version="${project.version}", + *;resolution:=optional + + + + + + + org.jboss.logging + jboss-logging + ${jboss.logging.version} + + + org.keycloak + keycloak-core + + + org.keycloak + keycloak-adapter-core + + + org.keycloak + keycloak-jetty-core + + + org.apache.httpcomponents + httpclient + + + org.bouncycastle + bcprov-jdk15on + + + com.fasterxml.jackson.core + jackson-core + + + com.fasterxml.jackson.core + jackson-databind + + + com.fasterxml.jackson.core + jackson-annotations + + + org.eclipse.jetty + jetty-server + ${jetty9.version} + provided + + + + org.eclipse.jetty + jetty-util + ${jetty9.version} + provided + + + + org.eclipse.jetty + jetty-security + ${jetty9.version} + provided + + + + junit + junit + test + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.6 + 1.6 + + + + + + maven-jar-plugin + + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + + org.apache.felix + maven-bundle-plugin + true + + + bundle-manifest + process-classes + + manifest + + + + + + . + ${project.name} + ${project.groupId}.${project.artifactId} + ${keycloak.osgi.import} + ${keycloak.osgi.export} + + + + + + + diff --git a/adapters/oidc/jetty/jetty9.4/src/main/java/org/keycloak/adapters/jetty/Jetty94RequestAuthenticator.java b/adapters/oidc/jetty/jetty9.4/src/main/java/org/keycloak/adapters/jetty/Jetty94RequestAuthenticator.java new file mode 100644 index 0000000000..fa6d75f7e9 --- /dev/null +++ b/adapters/oidc/jetty/jetty9.4/src/main/java/org/keycloak/adapters/jetty/Jetty94RequestAuthenticator.java @@ -0,0 +1,47 @@ +/* + * Copyright 2016 Red Hat, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. + * + * 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. + */ + +package org.keycloak.adapters.jetty; + +import org.eclipse.jetty.server.Request; +import org.keycloak.adapters.AdapterTokenStore; +import org.keycloak.adapters.KeycloakDeployment; +import org.keycloak.adapters.jetty.core.JettyRequestAuthenticator; +import org.keycloak.adapters.spi.HttpFacade; + +import javax.servlet.http.HttpSession; + +/** + * @author Bill Burke + * @version $Revision: 1 $ + */ +public class Jetty94RequestAuthenticator extends JettyRequestAuthenticator { + public Jetty94RequestAuthenticator(HttpFacade facade, KeycloakDeployment deployment, AdapterTokenStore tokenStore, int sslRedirectPort, Request request) { + super(facade, deployment, tokenStore, sslRedirectPort, request); + } + + @Override + protected String changeHttpSessionId(boolean create) { + Request request = this.request; + HttpSession session = request.getSession(false); + if (session == null) { + return request.getSession(true).getId(); + } + if (!deployment.isTurnOffChangeSessionIdOnLogin()) return request.changeSessionId(); + else return session.getId(); + } +} diff --git a/adapters/oidc/jetty/jetty9.4/src/main/java/org/keycloak/adapters/jetty/Jetty94SessionManager.java b/adapters/oidc/jetty/jetty9.4/src/main/java/org/keycloak/adapters/jetty/Jetty94SessionManager.java new file mode 100755 index 0000000000..f9e11fd468 --- /dev/null +++ b/adapters/oidc/jetty/jetty9.4/src/main/java/org/keycloak/adapters/jetty/Jetty94SessionManager.java @@ -0,0 +1,40 @@ +/* + * Copyright 2016 Red Hat, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. + * + * 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. + */ + +package org.keycloak.adapters.jetty; + +import org.eclipse.jetty.server.session.SessionHandler; +import org.keycloak.adapters.jetty.spi.JettySessionManager; + +import javax.servlet.http.HttpSession; + +/** + * @author Bill Burke + * @version $Revision: 1 $ + */ +public class Jetty94SessionManager implements JettySessionManager { + protected SessionHandler sessionHandler; + + public Jetty94SessionManager(SessionHandler sessionHandler) { + this.sessionHandler = sessionHandler; + } + + @Override + public HttpSession getHttpSession(String id) { + return sessionHandler.getHttpSession(id); + } +} diff --git a/adapters/oidc/jetty/jetty9.4/src/main/java/org/keycloak/adapters/jetty/JettyAdapterSessionStore.java b/adapters/oidc/jetty/jetty9.4/src/main/java/org/keycloak/adapters/jetty/JettyAdapterSessionStore.java new file mode 100644 index 0000000000..642bdf5663 --- /dev/null +++ b/adapters/oidc/jetty/jetty9.4/src/main/java/org/keycloak/adapters/jetty/JettyAdapterSessionStore.java @@ -0,0 +1,111 @@ +/* + * Copyright 2016 Red Hat, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. + * + * 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. + */ + +package org.keycloak.adapters.jetty; + +import org.eclipse.jetty.security.authentication.FormAuthenticator; +import org.eclipse.jetty.server.Request; +import org.eclipse.jetty.util.MultiMap; +import org.keycloak.adapters.jetty.spi.JettyHttpFacade; +import org.keycloak.adapters.spi.AdapterSessionStore; +import org.keycloak.common.util.MultivaluedHashMap; + +import javax.servlet.http.HttpSession; + +/** + * @author Bill Burke + * @version $Revision: 1 $ + */ +public class JettyAdapterSessionStore implements AdapterSessionStore { + public static final String CACHED_FORM_PARAMETERS = "__CACHED_FORM_PARAMETERS"; + protected Request myRequest; + + public JettyAdapterSessionStore(Request request) { + this.myRequest = request; // for IDE/compilation purposes + } + + protected MultiMap extractFormParameters(Request base_request) { + MultiMap formParameters = new MultiMap(); + base_request.extractFormParameters(formParameters); + return formParameters; + } + protected void restoreFormParameters(MultiMap j_post, Request base_request) { + base_request.setContentParameters(j_post); + } + + public boolean restoreRequest() { + HttpSession session = myRequest.getSession(false); + if (session == null) return false; + synchronized (session) { + String j_uri = (String) session.getAttribute(FormAuthenticator.__J_URI); + if (j_uri != null) { + // check if the request is for the same url as the original and restore + // params if it was a post + StringBuffer buf = myRequest.getRequestURL(); + if (myRequest.getQueryString() != null) + buf.append("?").append(myRequest.getQueryString()); + if (j_uri.equals(buf.toString())) { + String method = (String)session.getAttribute(JettyHttpFacade.__J_METHOD); + myRequest.setMethod(method); + MultivaluedHashMap j_post = (MultivaluedHashMap) session.getAttribute(CACHED_FORM_PARAMETERS); + if (j_post != null) { + myRequest.setContentType("application/x-www-form-urlencoded"); + MultiMap map = new MultiMap(); + for (String key : j_post.keySet()) { + for (String val : j_post.getList(key)) { + map.add(key, val); + } + } + restoreFormParameters(map, myRequest); + } + session.removeAttribute(FormAuthenticator.__J_URI); + session.removeAttribute(JettyHttpFacade.__J_METHOD); + session.removeAttribute(FormAuthenticator.__J_POST); + } + return true; + } + } + return false; + } + + public void saveRequest() { + // remember the current URI + HttpSession session = myRequest.getSession(); + synchronized (session) { + // But only if it is not set already, or we save every uri that leads to a login form redirect + if (session.getAttribute(FormAuthenticator.__J_URI) == null) { + StringBuffer buf = myRequest.getRequestURL(); + if (myRequest.getQueryString() != null) + buf.append("?").append(myRequest.getQueryString()); + session.setAttribute(FormAuthenticator.__J_URI, buf.toString()); + session.setAttribute(JettyHttpFacade.__J_METHOD, myRequest.getMethod()); + + if ("application/x-www-form-urlencoded".equals(myRequest.getContentType()) && "POST".equalsIgnoreCase(myRequest.getMethod())) { + MultiMap formParameters = extractFormParameters(myRequest); + MultivaluedHashMap map = new MultivaluedHashMap(); + for (String key : formParameters.keySet()) { + for (Object value : formParameters.getValues(key)) { + map.add(key, (String) value); + } + } + session.setAttribute(CACHED_FORM_PARAMETERS, map); + } + } + } + } + +} diff --git a/adapters/oidc/jetty/jetty9.4/src/main/java/org/keycloak/adapters/jetty/KeycloakJettyAuthenticator.java b/adapters/oidc/jetty/jetty9.4/src/main/java/org/keycloak/adapters/jetty/KeycloakJettyAuthenticator.java new file mode 100644 index 0000000000..800ba119e0 --- /dev/null +++ b/adapters/oidc/jetty/jetty9.4/src/main/java/org/keycloak/adapters/jetty/KeycloakJettyAuthenticator.java @@ -0,0 +1,75 @@ +/* + * Copyright 2016 Red Hat, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. + * + * 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. + */ + +package org.keycloak.adapters.jetty; + +import org.eclipse.jetty.server.Authentication; +import org.eclipse.jetty.server.Request; +import org.eclipse.jetty.server.UserIdentity; +import org.keycloak.adapters.AdapterTokenStore; +import org.keycloak.adapters.KeycloakDeployment; +import org.keycloak.adapters.jetty.core.AbstractKeycloakJettyAuthenticator; +import org.keycloak.adapters.jetty.core.JettyRequestAuthenticator; +import org.keycloak.adapters.jetty.core.JettySessionTokenStore; +import org.keycloak.adapters.jetty.spi.JettyHttpFacade; +import org.keycloak.adapters.jetty.spi.JettyUserSessionManagement; + +import javax.servlet.ServletRequest; + +/** + * @author Bill Burke + * @version $Revision: 1 $ + */ +public class KeycloakJettyAuthenticator extends AbstractKeycloakJettyAuthenticator { + + public KeycloakJettyAuthenticator() { + super(); + } + + + @Override + protected Request resolveRequest(ServletRequest req) { + return Request.getBaseRequest(req); + } + + @Override + protected Authentication createAuthentication(UserIdentity userIdentity, final Request request) { + return new KeycloakAuthentication(getAuthMethod(), userIdentity) { + @Override + public void logout() { + logoutCurrent(request); + } + }; + } + + @Override + public AdapterTokenStore createSessionTokenStore(Request request, KeycloakDeployment resolvedDeployment) { + return new JettySessionTokenStore(request, resolvedDeployment, new JettyAdapterSessionStore(request)); + } + + @Override + public JettyUserSessionManagement createSessionManagement(Request request) { + return new JettyUserSessionManagement(new Jetty94SessionManager(request.getSessionHandler())); + } + + @Override + protected JettyRequestAuthenticator createRequestAuthenticator(Request request, JettyHttpFacade facade, + KeycloakDeployment deployment, AdapterTokenStore tokenStore) { + return new Jetty94RequestAuthenticator(facade, deployment, tokenStore, -1, request); + } + +} diff --git a/adapters/oidc/jetty/pom.xml b/adapters/oidc/jetty/pom.xml index 0d83ac794c..7a3a7f0558 100755 --- a/adapters/oidc/jetty/pom.xml +++ b/adapters/oidc/jetty/pom.xml @@ -36,5 +36,6 @@ jetty9.1 jetty9.2 jetty9.3 + jetty9.4 diff --git a/adapters/saml/jetty/jetty-core/src/main/java/org/keycloak/adapters/saml/jetty/AbstractSamlAuthenticator.java b/adapters/saml/jetty/jetty-core/src/main/java/org/keycloak/adapters/saml/jetty/AbstractSamlAuthenticator.java index ec2d1ab08b..c0543e488a 100755 --- a/adapters/saml/jetty/jetty-core/src/main/java/org/keycloak/adapters/saml/jetty/AbstractSamlAuthenticator.java +++ b/adapters/saml/jetty/jetty-core/src/main/java/org/keycloak/adapters/saml/jetty/AbstractSamlAuthenticator.java @@ -104,12 +104,14 @@ public abstract class AbstractSamlAuthenticator extends LoginAuthenticator { protected JettySamlSessionStore createJettySamlSessionStore(Request request, HttpFacade facade, SamlDeployment resolvedDeployment) { JettySamlSessionStore store; - store = new JettySamlSessionStore(request, createSessionTokenStore(request, resolvedDeployment), facade, idMapper, new JettyUserSessionManagement(request.getSessionManager()), resolvedDeployment); + store = new JettySamlSessionStore(request, createSessionTokenStore(request, resolvedDeployment), facade, idMapper, createSessionManagement(request), resolvedDeployment); return store; } public abstract AdapterSessionStore createSessionTokenStore(Request request, SamlDeployment resolvedDeployment); + public abstract JettyUserSessionManagement createSessionManagement(Request request); + public void logoutCurrent(Request request) { JettyHttpFacade facade = new JettyHttpFacade(request, null); SamlDeployment deployment = deploymentContext.resolveDeployment(facade); diff --git a/adapters/saml/jetty/jetty8.1/src/main/java/org/keycloak/adapters/saml/jetty/Jetty8SessionManager.java b/adapters/saml/jetty/jetty8.1/src/main/java/org/keycloak/adapters/saml/jetty/Jetty8SessionManager.java new file mode 100755 index 0000000000..0ca8a21249 --- /dev/null +++ b/adapters/saml/jetty/jetty8.1/src/main/java/org/keycloak/adapters/saml/jetty/Jetty8SessionManager.java @@ -0,0 +1,40 @@ +/* + * Copyright 2016 Red Hat, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. + * + * 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. + */ + +package org.keycloak.adapters.saml.jetty; + +import org.eclipse.jetty.server.SessionManager; +import org.keycloak.adapters.jetty.spi.JettySessionManager; + +import javax.servlet.http.HttpSession; + +/** + * @author Bill Burke + * @version $Revision: 1 $ + */ +public class Jetty8SessionManager implements JettySessionManager { + protected SessionManager sessionManager; + + public Jetty8SessionManager(SessionManager sessionManager) { + this.sessionManager = sessionManager; + } + + @Override + public HttpSession getHttpSession(String id) { + return sessionManager.getHttpSession(id); + } +} diff --git a/adapters/saml/jetty/jetty8.1/src/main/java/org/keycloak/adapters/saml/jetty/KeycloakSamlAuthenticator.java b/adapters/saml/jetty/jetty8.1/src/main/java/org/keycloak/adapters/saml/jetty/KeycloakSamlAuthenticator.java index 85aaecffd1..381731b22a 100755 --- a/adapters/saml/jetty/jetty8.1/src/main/java/org/keycloak/adapters/saml/jetty/KeycloakSamlAuthenticator.java +++ b/adapters/saml/jetty/jetty8.1/src/main/java/org/keycloak/adapters/saml/jetty/KeycloakSamlAuthenticator.java @@ -21,6 +21,7 @@ import org.eclipse.jetty.server.AbstractHttpConnection; import org.eclipse.jetty.server.Authentication; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.UserIdentity; +import org.keycloak.adapters.jetty.spi.JettyUserSessionManagement; import org.keycloak.adapters.saml.SamlDeployment; import org.keycloak.adapters.spi.AdapterSessionStore; @@ -42,6 +43,11 @@ public class KeycloakSamlAuthenticator extends AbstractSamlAuthenticator { return new JettyAdapterSessionStore(request); } + @Override + public JettyUserSessionManagement createSessionManagement(Request request) { + return new JettyUserSessionManagement(new Jetty8SessionManager(request.getSessionManager())); + } + @Override protected Request resolveRequest(ServletRequest req) { return (req instanceof Request)?(Request)req: AbstractHttpConnection.getCurrentConnection().getRequest(); diff --git a/adapters/saml/jetty/jetty9.1/src/main/java/org/keycloak/adapters/saml/jetty/Jetty9SessionManager.java b/adapters/saml/jetty/jetty9.1/src/main/java/org/keycloak/adapters/saml/jetty/Jetty9SessionManager.java new file mode 100755 index 0000000000..7df883840e --- /dev/null +++ b/adapters/saml/jetty/jetty9.1/src/main/java/org/keycloak/adapters/saml/jetty/Jetty9SessionManager.java @@ -0,0 +1,40 @@ +/* + * Copyright 2016 Red Hat, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. + * + * 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. + */ + +package org.keycloak.adapters.saml.jetty; + +import org.eclipse.jetty.server.SessionManager; +import org.keycloak.adapters.jetty.spi.JettySessionManager; + +import javax.servlet.http.HttpSession; + +/** + * @author Bill Burke + * @version $Revision: 1 $ + */ +public class Jetty9SessionManager implements JettySessionManager { + protected SessionManager sessionManager; + + public Jetty9SessionManager(SessionManager sessionManager) { + this.sessionManager = sessionManager; + } + + @Override + public HttpSession getHttpSession(String id) { + return sessionManager.getHttpSession(id); + } +} diff --git a/adapters/saml/jetty/jetty9.1/src/main/java/org/keycloak/adapters/saml/jetty/KeycloakSamlAuthenticator.java b/adapters/saml/jetty/jetty9.1/src/main/java/org/keycloak/adapters/saml/jetty/KeycloakSamlAuthenticator.java index bb56306b5d..54b97a8047 100755 --- a/adapters/saml/jetty/jetty9.1/src/main/java/org/keycloak/adapters/saml/jetty/KeycloakSamlAuthenticator.java +++ b/adapters/saml/jetty/jetty9.1/src/main/java/org/keycloak/adapters/saml/jetty/KeycloakSamlAuthenticator.java @@ -44,6 +44,11 @@ public class KeycloakSamlAuthenticator extends AbstractSamlAuthenticator { return new JettyAdapterSessionStore(request); } + @Override + public JettyUserSessionManagement createSessionManagement(Request request) { + return new JettyUserSessionManagement(new Jetty9SessionManager(request.getSessionManager())); + } + @Override protected Request resolveRequest(ServletRequest req) { return (req instanceof Request) ? (Request)req : HttpChannel.getCurrentHttpChannel().getRequest(); @@ -62,7 +67,7 @@ public class KeycloakSamlAuthenticator extends AbstractSamlAuthenticator { @Override protected JettySamlSessionStore createJettySamlSessionStore(Request request, HttpFacade facade, SamlDeployment resolvedDeployment) { JettySamlSessionStore store; - store = new Jetty9SamlSessionStore(request, createSessionTokenStore(request, resolvedDeployment), facade, idMapper, new JettyUserSessionManagement(request.getSessionManager()), resolvedDeployment); + store = new Jetty9SamlSessionStore(request, createSessionTokenStore(request, resolvedDeployment), facade, idMapper, createSessionManagement(request), resolvedDeployment); return store; } diff --git a/adapters/saml/jetty/jetty9.2/src/main/java/org/keycloak/adapters/saml/jetty/Jetty9SessionManager.java b/adapters/saml/jetty/jetty9.2/src/main/java/org/keycloak/adapters/saml/jetty/Jetty9SessionManager.java new file mode 100755 index 0000000000..7df883840e --- /dev/null +++ b/adapters/saml/jetty/jetty9.2/src/main/java/org/keycloak/adapters/saml/jetty/Jetty9SessionManager.java @@ -0,0 +1,40 @@ +/* + * Copyright 2016 Red Hat, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. + * + * 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. + */ + +package org.keycloak.adapters.saml.jetty; + +import org.eclipse.jetty.server.SessionManager; +import org.keycloak.adapters.jetty.spi.JettySessionManager; + +import javax.servlet.http.HttpSession; + +/** + * @author Bill Burke + * @version $Revision: 1 $ + */ +public class Jetty9SessionManager implements JettySessionManager { + protected SessionManager sessionManager; + + public Jetty9SessionManager(SessionManager sessionManager) { + this.sessionManager = sessionManager; + } + + @Override + public HttpSession getHttpSession(String id) { + return sessionManager.getHttpSession(id); + } +} diff --git a/adapters/saml/jetty/jetty9.2/src/main/java/org/keycloak/adapters/saml/jetty/KeycloakSamlAuthenticator.java b/adapters/saml/jetty/jetty9.2/src/main/java/org/keycloak/adapters/saml/jetty/KeycloakSamlAuthenticator.java index 4f79b35711..16af5e28b4 100755 --- a/adapters/saml/jetty/jetty9.2/src/main/java/org/keycloak/adapters/saml/jetty/KeycloakSamlAuthenticator.java +++ b/adapters/saml/jetty/jetty9.2/src/main/java/org/keycloak/adapters/saml/jetty/KeycloakSamlAuthenticator.java @@ -59,10 +59,15 @@ public class KeycloakSamlAuthenticator extends AbstractSamlAuthenticator { return new JettyAdapterSessionStore(request); } + @Override + public JettyUserSessionManagement createSessionManagement(Request request) { + return new JettyUserSessionManagement(new Jetty9SessionManager(request.getSessionManager())); + } + @Override protected JettySamlSessionStore createJettySamlSessionStore(Request request, HttpFacade facade, SamlDeployment resolvedDeployment) { JettySamlSessionStore store; - store = new Jetty9SamlSessionStore(request, createSessionTokenStore(request, resolvedDeployment), facade, idMapper, new JettyUserSessionManagement(request.getSessionManager()), resolvedDeployment); + store = new Jetty9SamlSessionStore(request, createSessionTokenStore(request, resolvedDeployment), facade, idMapper, createSessionManagement(request), resolvedDeployment); return store; } } diff --git a/adapters/saml/jetty/jetty9.3/src/main/java/org/keycloak/adapters/saml/jetty/Jetty9SessionManager.java b/adapters/saml/jetty/jetty9.3/src/main/java/org/keycloak/adapters/saml/jetty/Jetty9SessionManager.java new file mode 100755 index 0000000000..7df883840e --- /dev/null +++ b/adapters/saml/jetty/jetty9.3/src/main/java/org/keycloak/adapters/saml/jetty/Jetty9SessionManager.java @@ -0,0 +1,40 @@ +/* + * Copyright 2016 Red Hat, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. + * + * 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. + */ + +package org.keycloak.adapters.saml.jetty; + +import org.eclipse.jetty.server.SessionManager; +import org.keycloak.adapters.jetty.spi.JettySessionManager; + +import javax.servlet.http.HttpSession; + +/** + * @author Bill Burke + * @version $Revision: 1 $ + */ +public class Jetty9SessionManager implements JettySessionManager { + protected SessionManager sessionManager; + + public Jetty9SessionManager(SessionManager sessionManager) { + this.sessionManager = sessionManager; + } + + @Override + public HttpSession getHttpSession(String id) { + return sessionManager.getHttpSession(id); + } +} diff --git a/adapters/saml/jetty/jetty9.3/src/main/java/org/keycloak/adapters/saml/jetty/KeycloakSamlAuthenticator.java b/adapters/saml/jetty/jetty9.3/src/main/java/org/keycloak/adapters/saml/jetty/KeycloakSamlAuthenticator.java index 91d320c918..825e52284d 100644 --- a/adapters/saml/jetty/jetty9.3/src/main/java/org/keycloak/adapters/saml/jetty/KeycloakSamlAuthenticator.java +++ b/adapters/saml/jetty/jetty9.3/src/main/java/org/keycloak/adapters/saml/jetty/KeycloakSamlAuthenticator.java @@ -58,10 +58,15 @@ public class KeycloakSamlAuthenticator extends AbstractSamlAuthenticator { return new JettyAdapterSessionStore(request); } + @Override + public JettyUserSessionManagement createSessionManagement(Request request) { + return new JettyUserSessionManagement(new Jetty9SessionManager(request.getSessionManager())); + } + @Override protected JettySamlSessionStore createJettySamlSessionStore(Request request, HttpFacade facade, SamlDeployment resolvedDeployment) { JettySamlSessionStore store; - store = new Jetty9SamlSessionStore(request, createSessionTokenStore(request, resolvedDeployment), facade, idMapper, new JettyUserSessionManagement(request.getSessionManager()), resolvedDeployment); + store = new Jetty9SamlSessionStore(request, createSessionTokenStore(request, resolvedDeployment), facade, idMapper, createSessionManagement(request), resolvedDeployment); return store; } } diff --git a/adapters/saml/jetty/jetty9.4/pom.xml b/adapters/saml/jetty/jetty9.4/pom.xml new file mode 100644 index 0000000000..49575ce59f --- /dev/null +++ b/adapters/saml/jetty/jetty9.4/pom.xml @@ -0,0 +1,162 @@ + + + + + + keycloak-parent + org.keycloak + 3.0.0.CR1-SNAPSHOT + ../../../../pom.xml + + 4.0.0 + + keycloak-saml-jetty94-adapter + Keycloak Jetty 9.4.x SAML Integration + + 9.4.2.v20170220 + + org.keycloak.adapters.jetty.* + + + org.eclipse.jetty.*;resolution:=optional, + javax.servlet.*;version="[3.0,4)";resolution:=optional, + org.keycloak.*;version="${project.version}", + *;resolution:=optional + + + + + + + org.jboss.logging + jboss-logging + ${jboss.logging.version} + + + org.keycloak + keycloak-common + + + org.bouncycastle + bcprov-jdk15on + + + org.keycloak + keycloak-saml-adapter-api-public + + + org.keycloak + keycloak-saml-adapter-core + + + org.keycloak + keycloak-adapter-spi + + + org.keycloak + keycloak-saml-jetty-adapter-core + + + org.eclipse.jetty + jetty-server + + + org.eclipse.jetty + jetty-util + + + org.eclipse.jetty + jetty-security + + + + + org.eclipse.jetty + jetty-server + ${jetty9.version} + provided + + + + org.eclipse.jetty + jetty-util + ${jetty9.version} + provided + + + + org.eclipse.jetty + jetty-security + ${jetty9.version} + provided + + + + junit + junit + test + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.6 + 1.6 + + + + + + maven-jar-plugin + + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + + org.apache.felix + maven-bundle-plugin + true + + + bundle-manifest + process-classes + + manifest + + + + + + . + ${project.name} + ${project.groupId}.${project.artifactId} + ${keycloak.osgi.import} + ${keycloak.osgi.export} + + + + + + + diff --git a/adapters/saml/jetty/jetty9.4/src/main/java/org/keycloak/adapters/saml/jetty/Jetty9SamlSessionStore.java b/adapters/saml/jetty/jetty9.4/src/main/java/org/keycloak/adapters/saml/jetty/Jetty9SamlSessionStore.java new file mode 100644 index 0000000000..fa618cb573 --- /dev/null +++ b/adapters/saml/jetty/jetty9.4/src/main/java/org/keycloak/adapters/saml/jetty/Jetty9SamlSessionStore.java @@ -0,0 +1,44 @@ +/* + * Copyright 2016 Red Hat, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. + * + * 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. + */ + +package org.keycloak.adapters.saml.jetty; + +import org.eclipse.jetty.server.Request; +import org.keycloak.adapters.jetty.spi.JettyUserSessionManagement; +import org.keycloak.adapters.saml.SamlDeployment; +import org.keycloak.adapters.spi.AdapterSessionStore; +import org.keycloak.adapters.spi.HttpFacade; +import org.keycloak.adapters.spi.SessionIdMapper; + +import javax.servlet.http.HttpSession; + +/** + * @author Bill Burke + * @version $Revision: 1 $ + */ +public class Jetty9SamlSessionStore extends JettySamlSessionStore { + public Jetty9SamlSessionStore(Request request, AdapterSessionStore sessionStore, HttpFacade facade, SessionIdMapper idMapper, JettyUserSessionManagement sessionManagement, SamlDeployment deployment) { + super(request, sessionStore, facade, idMapper, sessionManagement, deployment); + } + + @Override + protected String changeSessionId(HttpSession session) { + Request request = this.request; + if (!deployment.turnOffChangeSessionIdOnLogin()) return request.changeSessionId(); + else return session.getId(); + } +} diff --git a/adapters/saml/jetty/jetty9.4/src/main/java/org/keycloak/adapters/saml/jetty/Jetty9SessionManager.java b/adapters/saml/jetty/jetty9.4/src/main/java/org/keycloak/adapters/saml/jetty/Jetty9SessionManager.java new file mode 100755 index 0000000000..e21fcc1c66 --- /dev/null +++ b/adapters/saml/jetty/jetty9.4/src/main/java/org/keycloak/adapters/saml/jetty/Jetty9SessionManager.java @@ -0,0 +1,40 @@ +/* + * Copyright 2016 Red Hat, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. + * + * 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. + */ + +package org.keycloak.adapters.saml.jetty; + +import org.eclipse.jetty.server.session.SessionHandler; +import org.keycloak.adapters.jetty.spi.JettySessionManager; + +import javax.servlet.http.HttpSession; + +/** + * @author Bill Burke + * @version $Revision: 1 $ + */ +public class Jetty9SessionManager implements JettySessionManager { + protected SessionHandler sessionHandler; + + public Jetty9SessionManager(SessionHandler sessionHandler) { + this.sessionHandler = sessionHandler; + } + + @Override + public HttpSession getHttpSession(String id) { + return sessionHandler.getHttpSession(id); + } +} diff --git a/adapters/saml/jetty/jetty9.4/src/main/java/org/keycloak/adapters/saml/jetty/JettyAdapterSessionStore.java b/adapters/saml/jetty/jetty9.4/src/main/java/org/keycloak/adapters/saml/jetty/JettyAdapterSessionStore.java new file mode 100644 index 0000000000..17246056c6 --- /dev/null +++ b/adapters/saml/jetty/jetty9.4/src/main/java/org/keycloak/adapters/saml/jetty/JettyAdapterSessionStore.java @@ -0,0 +1,111 @@ +/* + * Copyright 2016 Red Hat, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. + * + * 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. + */ + +package org.keycloak.adapters.saml.jetty; + +import org.eclipse.jetty.security.authentication.FormAuthenticator; +import org.eclipse.jetty.server.Request; +import org.eclipse.jetty.util.MultiMap; +import org.keycloak.adapters.jetty.spi.JettyHttpFacade; +import org.keycloak.adapters.spi.AdapterSessionStore; +import org.keycloak.common.util.MultivaluedHashMap; + +import javax.servlet.http.HttpSession; + +/** + * @author Bill Burke + * @version $Revision: 1 $ + */ +public class JettyAdapterSessionStore implements AdapterSessionStore { + public static final String CACHED_FORM_PARAMETERS = "__CACHED_FORM_PARAMETERS"; + protected Request myRequest; + + public JettyAdapterSessionStore(Request request) { + this.myRequest = request; // for IDE/compilation purposes + } + + protected MultiMap extractFormParameters(Request base_request) { + MultiMap formParameters = new MultiMap(); + base_request.extractFormParameters(formParameters); + return formParameters; + } + protected void restoreFormParameters(MultiMap j_post, Request base_request) { + base_request.setContentParameters(j_post); + } + + public boolean restoreRequest() { + HttpSession session = myRequest.getSession(false); + if (session == null) return false; + synchronized (session) { + String j_uri = (String) session.getAttribute(FormAuthenticator.__J_URI); + if (j_uri != null) { + // check if the request is for the same url as the original and restore + // params if it was a post + StringBuffer buf = myRequest.getRequestURL(); + if (myRequest.getQueryString() != null) + buf.append("?").append(myRequest.getQueryString()); + if (j_uri.equals(buf.toString())) { + String method = (String)session.getAttribute(JettyHttpFacade.__J_METHOD); + myRequest.setMethod(method); + MultivaluedHashMap j_post = (MultivaluedHashMap) session.getAttribute(CACHED_FORM_PARAMETERS); + if (j_post != null) { + myRequest.setContentType("application/x-www-form-urlencoded"); + MultiMap map = new MultiMap(); + for (String key : j_post.keySet()) { + for (String val : j_post.getList(key)) { + map.add(key, val); + } + } + restoreFormParameters(map, myRequest); + } + session.removeAttribute(FormAuthenticator.__J_URI); + session.removeAttribute(JettyHttpFacade.__J_METHOD); + session.removeAttribute(FormAuthenticator.__J_POST); + } + return true; + } + } + return false; + } + + public void saveRequest() { + // remember the current URI + HttpSession session = myRequest.getSession(); + synchronized (session) { + // But only if it is not set already, or we save every uri that leads to a login form redirect + if (session.getAttribute(FormAuthenticator.__J_URI) == null) { + StringBuffer buf = myRequest.getRequestURL(); + if (myRequest.getQueryString() != null) + buf.append("?").append(myRequest.getQueryString()); + session.setAttribute(FormAuthenticator.__J_URI, buf.toString()); + session.setAttribute(JettyHttpFacade.__J_METHOD, myRequest.getMethod()); + + if ("application/x-www-form-urlencoded".equals(myRequest.getContentType()) && "POST".equalsIgnoreCase(myRequest.getMethod())) { + MultiMap formParameters = extractFormParameters(myRequest); + MultivaluedHashMap map = new MultivaluedHashMap(); + for (String key : formParameters.keySet()) { + for (Object value : formParameters.getValues(key)) { + map.add(key, (String) value); + } + } + session.setAttribute(CACHED_FORM_PARAMETERS, map); + } + } + } + } + +} diff --git a/adapters/saml/jetty/jetty9.4/src/main/java/org/keycloak/adapters/saml/jetty/KeycloakSamlAuthenticator.java b/adapters/saml/jetty/jetty9.4/src/main/java/org/keycloak/adapters/saml/jetty/KeycloakSamlAuthenticator.java new file mode 100644 index 0000000000..8d76fe1a8a --- /dev/null +++ b/adapters/saml/jetty/jetty9.4/src/main/java/org/keycloak/adapters/saml/jetty/KeycloakSamlAuthenticator.java @@ -0,0 +1,72 @@ +/* + * Copyright 2016 Red Hat, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. + * + * 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. + */ + +package org.keycloak.adapters.saml.jetty; + +import org.eclipse.jetty.server.Authentication; +import org.eclipse.jetty.server.Request; +import org.eclipse.jetty.server.UserIdentity; +import org.keycloak.adapters.jetty.spi.JettyUserSessionManagement; +import org.keycloak.adapters.saml.SamlDeployment; +import org.keycloak.adapters.spi.AdapterSessionStore; +import org.keycloak.adapters.spi.HttpFacade; + +import javax.servlet.ServletRequest; + +/** + * @author Bill Burke + * @version $Revision: 1 $ + */ +public class KeycloakSamlAuthenticator extends AbstractSamlAuthenticator { + + public KeycloakSamlAuthenticator() { + super(); + } + + + @Override + protected Request resolveRequest(ServletRequest req) { + return Request.getBaseRequest(req); + } + + @Override + public Authentication createAuthentication(UserIdentity userIdentity, final Request request) { + return new KeycloakAuthentication(getAuthMethod(), userIdentity) { + @Override + public void logout() { + logoutCurrent(request); + } + }; + } + + @Override + public AdapterSessionStore createSessionTokenStore(Request request, SamlDeployment resolvedDeployment) { + return new JettyAdapterSessionStore(request); + } + + @Override + public JettyUserSessionManagement createSessionManagement(Request request) { + return new JettyUserSessionManagement(new Jetty9SessionManager(request.getSessionHandler())); + } + + @Override + protected JettySamlSessionStore createJettySamlSessionStore(Request request, HttpFacade facade, SamlDeployment resolvedDeployment) { + JettySamlSessionStore store; + store = new Jetty9SamlSessionStore(request, createSessionTokenStore(request, resolvedDeployment), facade, idMapper, createSessionManagement(request), resolvedDeployment); + return store; + } +} diff --git a/adapters/saml/jetty/pom.xml b/adapters/saml/jetty/pom.xml index 86f74e6d1a..8f76108a00 100755 --- a/adapters/saml/jetty/pom.xml +++ b/adapters/saml/jetty/pom.xml @@ -36,5 +36,6 @@ jetty9.1 jetty9.2 jetty9.3 + jetty9.4 diff --git a/adapters/spi/jetty-adapter-spi/src/main/java/org/keycloak/adapters/jetty/spi/JettySessionManager.java b/adapters/spi/jetty-adapter-spi/src/main/java/org/keycloak/adapters/jetty/spi/JettySessionManager.java new file mode 100644 index 0000000000..645ce1f48c --- /dev/null +++ b/adapters/spi/jetty-adapter-spi/src/main/java/org/keycloak/adapters/jetty/spi/JettySessionManager.java @@ -0,0 +1,28 @@ +/* + * Copyright 2016 Red Hat, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. + * + * 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. + */ + +package org.keycloak.adapters.jetty.spi; + +import javax.servlet.http.HttpSession; + +/** + * @author Marek Posolda + */ +public interface JettySessionManager { + + public HttpSession getHttpSession(String id); +} diff --git a/adapters/spi/jetty-adapter-spi/src/main/java/org/keycloak/adapters/jetty/spi/JettyUserSessionManagement.java b/adapters/spi/jetty-adapter-spi/src/main/java/org/keycloak/adapters/jetty/spi/JettyUserSessionManagement.java index e864fd22bb..55ebd32c92 100755 --- a/adapters/spi/jetty-adapter-spi/src/main/java/org/keycloak/adapters/jetty/spi/JettyUserSessionManagement.java +++ b/adapters/spi/jetty-adapter-spi/src/main/java/org/keycloak/adapters/jetty/spi/JettyUserSessionManagement.java @@ -17,7 +17,6 @@ package org.keycloak.adapters.jetty.spi; -import org.eclipse.jetty.server.SessionManager; import org.jboss.logging.Logger; import org.keycloak.adapters.spi.UserSessionManagement; @@ -30,9 +29,9 @@ import java.util.List; */ public class JettyUserSessionManagement implements UserSessionManagement { private static final org.jboss.logging.Logger log = Logger.getLogger(JettyUserSessionManagement.class); - protected SessionManager sessionManager; + protected JettySessionManager sessionManager; - public JettyUserSessionManagement(SessionManager sessionManager) { + public JettyUserSessionManagement(JettySessionManager sessionManager) { this.sessionManager = sessionManager; } diff --git a/distribution/adapters/jetty94-adapter-zip/assembly.xml b/distribution/adapters/jetty94-adapter-zip/assembly.xml new file mode 100644 index 0000000000..bbb90d9830 --- /dev/null +++ b/distribution/adapters/jetty94-adapter-zip/assembly.xml @@ -0,0 +1,56 @@ + + + + war-dist + + + zip + tar.gz + + false + + + + + + keycloak.mod + + modules + + + ${project.build.directory}/modules + + + + + + false + true + true + + org.keycloak:keycloak-jetty94-adapter + + + org.eclipse.jetty:jetty-server + org.eclipse.jetty:jetty-util + org.eclipse.jetty:jetty-security + + lib/keycloak + + + diff --git a/distribution/adapters/jetty94-adapter-zip/keycloak.mod b/distribution/adapters/jetty94-adapter-zip/keycloak.mod new file mode 100644 index 0000000000..4da630848f --- /dev/null +++ b/distribution/adapters/jetty94-adapter-zip/keycloak.mod @@ -0,0 +1,28 @@ +# +# Keycloak Jetty Adapter +# + +[depend] +server +security + +[lib] + + +lib/keycloak/*.jar + diff --git a/distribution/adapters/jetty94-adapter-zip/pom.xml b/distribution/adapters/jetty94-adapter-zip/pom.xml new file mode 100644 index 0000000000..e4e9f1538a --- /dev/null +++ b/distribution/adapters/jetty94-adapter-zip/pom.xml @@ -0,0 +1,68 @@ + + + + 4.0.0 + + keycloak-parent + org.keycloak + 3.0.0.CR1-SNAPSHOT + ../../../pom.xml + + + keycloak-jetty94-adapter-dist + pom + Keycloak Jetty 9.4.x Adapter Distro + + + + + org.keycloak + keycloak-jetty94-adapter + + + + + + maven-assembly-plugin + + + assemble + package + + single + + + + assembly.xml + + + target + + + target/assembly/work + + false + + + + + + + + diff --git a/distribution/adapters/pom.xml b/distribution/adapters/pom.xml index ed8f1ba1d5..b0d64d84e7 100755 --- a/distribution/adapters/pom.xml +++ b/distribution/adapters/pom.xml @@ -37,6 +37,7 @@ jetty91-adapter-zip jetty92-adapter-zip jetty93-adapter-zip + jetty94-adapter-zip js-adapter-zip osgi tomcat6-adapter-zip diff --git a/distribution/downloads/src/main/resources/files b/distribution/downloads/src/main/resources/files index e88c8e99a7..24aebf8ac8 100644 --- a/distribution/downloads/src/main/resources/files +++ b/distribution/downloads/src/main/resources/files @@ -13,6 +13,7 @@ keycloak-jetty91-adapter-dist keycloak-jetty92-adapter-dist keycloak-jetty93-adapter-dist + keycloak-jetty94-adapter-dist keycloak-js-adapter-dist keycloak-tomcat6-adapter-dist keycloak-tomcat7-adapter-dist @@ -27,6 +28,7 @@ keycloak-saml-jetty81-adapter-dist keycloak-saml-jetty92-adapter-dist keycloak-saml-jetty93-adapter-dist + keycloak-saml-jetty94-adapter-dist keycloak-saml-tomcat6-adapter-dist keycloak-saml-tomcat7-adapter-dist keycloak-saml-tomcat8-adapter-dist diff --git a/distribution/saml-adapters/jetty94-adapter-zip/assembly.xml b/distribution/saml-adapters/jetty94-adapter-zip/assembly.xml new file mode 100644 index 0000000000..88267704d7 --- /dev/null +++ b/distribution/saml-adapters/jetty94-adapter-zip/assembly.xml @@ -0,0 +1,56 @@ + + + + war-dist + + + zip + tar.gz + + false + + + + + + keycloak.mod + + modules + + + ${project.build.directory}/modules + + + + + + false + true + true + + org.keycloak:keycloak-saml-jetty94-adapter + + + org.eclipse.jetty:jetty-server + org.eclipse.jetty:jetty-util + org.eclipse.jetty:jetty-security + + lib/keycloak + + + diff --git a/distribution/saml-adapters/jetty94-adapter-zip/keycloak.mod b/distribution/saml-adapters/jetty94-adapter-zip/keycloak.mod new file mode 100644 index 0000000000..4da630848f --- /dev/null +++ b/distribution/saml-adapters/jetty94-adapter-zip/keycloak.mod @@ -0,0 +1,28 @@ +# +# Keycloak Jetty Adapter +# + +[depend] +server +security + +[lib] + + +lib/keycloak/*.jar + diff --git a/distribution/saml-adapters/jetty94-adapter-zip/pom.xml b/distribution/saml-adapters/jetty94-adapter-zip/pom.xml new file mode 100644 index 0000000000..ce404303b2 --- /dev/null +++ b/distribution/saml-adapters/jetty94-adapter-zip/pom.xml @@ -0,0 +1,68 @@ + + + + 4.0.0 + + keycloak-parent + org.keycloak + 3.0.0.CR1-SNAPSHOT + ../../../pom.xml + + + keycloak-saml-jetty94-adapter-dist + pom + Keycloak SAML Jetty 9.4.x Adapter Distro + + + + + org.keycloak + keycloak-saml-jetty94-adapter + + + + + + maven-assembly-plugin + + + assemble + package + + single + + + + assembly.xml + + + target + + + target/assembly/work + + false + + + + + + + + diff --git a/distribution/saml-adapters/pom.xml b/distribution/saml-adapters/pom.xml index e749f565f7..93eb180e45 100755 --- a/distribution/saml-adapters/pom.xml +++ b/distribution/saml-adapters/pom.xml @@ -40,6 +40,7 @@ jetty91-adapter-zip --> jetty92-adapter-zip jetty93-adapter-zip + jetty94-adapter-zip as7-eap6-adapter diff --git a/pom.xml b/pom.xml index 320b8daae6..72a4c4a115 100755 --- a/pom.xml +++ b/pom.xml @@ -796,6 +796,11 @@ keycloak-jetty93-adapter ${project.version} + + org.keycloak + keycloak-jetty94-adapter + ${project.version} + org.keycloak keycloak-as7-subsystem @@ -1016,6 +1021,11 @@ keycloak-saml-jetty93-adapter ${project.version} + + org.keycloak + keycloak-saml-jetty94-adapter + ${project.version} + org.keycloak keycloak-saml-undertow-adapter @@ -1187,6 +1197,12 @@ ${project.version} zip + + org.keycloak + keycloak-jetty94-adapter-dist + ${project.version} + zip + org.keycloak keycloak-js-adapter-dist @@ -1247,6 +1263,12 @@ ${project.version} zip + + org.keycloak + keycloak-saml-jetty94-adapter-dist + ${project.version} + zip + org.keycloak keycloak-saml-as7-adapter-dist diff --git a/testsuite/jetty/jetty94/pom.xml b/testsuite/jetty/jetty94/pom.xml new file mode 100644 index 0000000000..f5eaa0f6bd --- /dev/null +++ b/testsuite/jetty/jetty94/pom.xml @@ -0,0 +1,427 @@ + + + + + + keycloak-testsuite-pom + org.keycloak + 3.0.0.CR1-SNAPSHOT + ../../pom.xml + + 4.0.0 + + keycloak-testsuite-jetty94 + Keycloak Jetty 9.4.x Integration TestSuite + + 9.4.2.v20170220 + + + + + + org.keycloak + keycloak-dependencies-server-all + pom + + + org.keycloak + keycloak-admin-client + + + org.keycloak + keycloak-saml-jetty94-adapter + + + log4j + log4j + + + org.slf4j + slf4j-api + 1.6.1 + + + org.slf4j + slf4j-log4j12 + 1.6.1 + + + org.jboss.spec.javax.servlet + jboss-servlet-api_3.0_spec + + + org.jboss.spec.javax.ws.rs + jboss-jaxrs-api_2.0_spec + + + org.jboss.resteasy + resteasy-jaxrs + + + log4j + log4j + + + org.slf4j + slf4j-api + + + org.slf4j + slf4j-simple + + + + + org.jboss.resteasy + resteasy-client + + + org.jboss.resteasy + resteasy-multipart-provider + + + org.jboss.resteasy + resteasy-jackson2-provider + + + org.jboss.resteasy + resteasy-undertow + + + com.google.zxing + javase + + + org.bouncycastle + bcprov-jdk15on + + + org.apache.httpcomponents + httpclient + + + org.keycloak + keycloak-ldap-federation + + + org.keycloak + keycloak-kerberos-federation + + + org.keycloak + keycloak-undertow-adapter + + + org.keycloak + keycloak-jetty94-adapter + + + org.jboss.logging + jboss-logging + + + io.undertow + undertow-servlet + + + io.undertow + undertow-core + + + com.fasterxml.jackson.core + jackson-core + + + com.fasterxml.jackson.core + jackson-databind + + + com.fasterxml.jackson.core + jackson-annotations + + + junit + junit + + + org.hamcrest + hamcrest-all + + + org.hibernate.javax.persistence + hibernate-jpa-2.1-api + + + com.h2database + h2 + + + org.hibernate + hibernate-entitymanager + + + com.icegreen + greenmail + + + org.slf4j + slf4j-api + + + + + org.infinispan + infinispan-core + + + org.seleniumhq.selenium + selenium-java + + + xml-apis + xml-apis + + + org.seleniumhq.selenium + selenium-chrome-driver + + + org.wildfly + wildfly-undertow + ${wildfly.version} + test + + + org.keycloak + keycloak-testsuite-integration + test + + + org.keycloak + keycloak-testsuite-integration + test-jar + test + + + org.eclipse.jetty + jetty-jaas + ${jetty9.version} + provided + + + + org.eclipse.jetty + jetty-util + ${jetty9.version} + provided + + + + org.eclipse.jetty + jetty-webapp + ${jetty9.version} + provided + + + + org.eclipse.jetty + jetty-security + ${jetty9.version} + provided + + + + org.eclipse.jetty + jetty-servlet + ${jetty9.version} + provided + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + test-jar + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + true + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${maven.compiler.source} + ${maven.compiler.target} + + + + org.codehaus.mojo + exec-maven-plugin + + ${project.basedir} + + + + + + + + keycloak-server + + + + org.codehaus.mojo + exec-maven-plugin + + org.keycloak.testsuite.KeycloakServer + + + + + + + mail-server + + + + org.codehaus.mojo + exec-maven-plugin + + org.keycloak.testsuite.MailServer + + + + + + + totp + + + + org.codehaus.mojo + exec-maven-plugin + + org.keycloak.testsuite.TotpGenerator + + + + + + + + jpa + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + jpa + jpa + jpa + + + + + + + + + + + + keycloak.connectionsJpa.driver + com.mysql.jdbc.Driver + + + mysql + + + mysql + mysql-connector-java + ${mysql.version} + + + + + + + + + keycloak.connectionsJpa.driver + org.postgresql.Driver + + + postgresql + + + org.postgresql + postgresql + ${postgresql.version} + + + + + + clean-jpa + + + + org.liquibase + liquibase-maven-plugin + + META-INF/jpa-changelog-master.xml + + ${keycloak.connectionsJpa.url} + ${keycloak.connectionsJpa.driver} + ${keycloak.connectionsJpa.user} + ${keycloak.connectionsJpa.password} + + false + + + + clean-jpa + clean + + dropAll + + + + + + + + + diff --git a/testsuite/jetty/jetty94/src/test/java/org/keycloak/testsuite/Jetty9Test.java b/testsuite/jetty/jetty94/src/test/java/org/keycloak/testsuite/Jetty9Test.java new file mode 100644 index 0000000000..bd53150b1d --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/java/org/keycloak/testsuite/Jetty9Test.java @@ -0,0 +1,197 @@ +/* + * Copyright 2016 Red Hat, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. + * + * 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. + */ +package org.keycloak.testsuite; + +import org.eclipse.jetty.server.Handler; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.server.handler.HandlerCollection; +import org.eclipse.jetty.webapp.WebAppContext; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.ClassRule; +import org.junit.Rule; +import org.junit.Test; +import org.keycloak.models.KeycloakSession; +import org.keycloak.models.RealmModel; +import org.keycloak.services.managers.RealmManager; +import org.keycloak.testsuite.adapter.AdapterTestStrategy; +import org.keycloak.testsuite.rule.AbstractKeycloakRule; + +import java.io.File; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; + +/** + * @author Stian Thorgersen + */ +public class Jetty9Test { + @ClassRule + public static AbstractKeycloakRule keycloakRule = new AbstractKeycloakRule() { + @Override + protected void configure(KeycloakSession session, RealmManager manager, RealmModel adminRealm) { + AdapterTestStrategy.baseAdapterTestInitialization(session, manager, adminRealm, getClass()); + } + }; + + public static Server server = null; + + + @BeforeClass + public static void initJetty() throws Exception { + server = new Server(8082); + List list = new ArrayList(); + System.setProperty("app.server.base.url", "http://localhost:8082"); + System.setProperty("my.host.name", "localhost"); + URL dir = Jetty9Test.class.getResource("/adapter-test/demorealm.json"); + File base = new File(dir.getFile()).getParentFile(); + list.add(new WebAppContext(new File(base, "customer-portal").toString(), "/customer-portal")); + list.add(new WebAppContext(new File(base, "customer-db").toString(), "/customer-db")); + list.add(new WebAppContext(new File(base, "customer-db-error-page").toString(), "/customer-db-error-page")); + list.add(new WebAppContext(new File(base, "product-portal").toString(), "/product-portal")); + list.add(new WebAppContext(new File(base, "session-portal").toString(), "/session-portal")); + list.add(new WebAppContext(new File(base, "input-portal").toString(), "/input-portal")); + list.add(new WebAppContext(new File(base, "secure-portal").toString(), "/secure-portal")); + + + + HandlerCollection handlers = new HandlerCollection(); + handlers.setHandlers(list.toArray(new Handler[list.size()])); + server.setHandler(handlers); + + server.start(); + } + + + + @AfterClass + public static void shutdownJetty() throws Exception { + try { + server.stop(); + server.destroy(); + Thread.sleep(100); + } catch (Exception e) {} + } + + @Rule + public AdapterTestStrategy testStrategy = new AdapterTestStrategy("http://localhost:8081/auth", "http://localhost:8082", keycloakRule, true); + + @Test + public void testLoginSSOAndLogout() throws Exception { + testStrategy.testLoginSSOAndLogout(); + } + + @Test + public void testLoginEncodedRedirectUri() throws Exception { + testStrategy.testLoginEncodedRedirectUri(); + } + + + @Test + public void testSavedPostRequest() throws Exception { + testStrategy.testSavedPostRequest(); + } + + @Test + public void testServletRequestLogout() throws Exception { + testStrategy.testServletRequestLogout(); + } + + @Test + public void testLoginSSOIdle() throws Exception { + testStrategy.testLoginSSOIdle(); + + } + + @Test + public void testLoginSSOIdleRemoveExpiredUserSessions() throws Exception { + testStrategy.testLoginSSOIdleRemoveExpiredUserSessions(); + } + + @Test + public void testLoginSSOMax() throws Exception { + testStrategy.testLoginSSOMax(); + } + + /** + * KEYCLOAK-518 + * @throws Exception + */ + @Test + public void testNullBearerToken() throws Exception { + testStrategy.testNullBearerToken(); + } + + /** + * KEYCLOAK-1368 + * @throws Exception + */ + @Test + public void testNullBearerTokenCustomErrorPage() throws Exception { + testStrategy.testNullBearerTokenCustomErrorPage(); + } + + /** + * KEYCLOAK-518 + * @throws Exception + */ + @Test + public void testBadUser() throws Exception { + testStrategy.testBadUser(); + } + + @Test + public void testVersion() throws Exception { + testStrategy.testVersion(); + } + + + /** + * KEYCLOAK-732 + * + * @throws Throwable + */ + @Test + public void testSingleSessionInvalidated() throws Throwable { + testStrategy.testSingleSessionInvalidated(); + } + + /** + * KEYCLOAK-741 + */ + @Test + public void testSessionInvalidatedAfterFailedRefresh() throws Throwable { + testStrategy.testSessionInvalidatedAfterFailedRefresh(); + + } + + /** + * KEYCLOAK-942 + */ + @Test + public void testAdminApplicationLogout() throws Throwable { + testStrategy.testAdminApplicationLogout(); + } + + /** + * KEYCLOAK-1216 + */ + @Test + public void testAccountManagementSessionsLogout() throws Throwable { + testStrategy.testAccountManagementSessionsLogout(); + } +} diff --git a/testsuite/jetty/jetty94/src/test/java/org/keycloak/testsuite/JettySamlTest.java b/testsuite/jetty/jetty94/src/test/java/org/keycloak/testsuite/JettySamlTest.java new file mode 100644 index 0000000000..f1e72a4d30 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/java/org/keycloak/testsuite/JettySamlTest.java @@ -0,0 +1,204 @@ +/* + * Copyright 2016 Red Hat, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. + * + * 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. + */ +package org.keycloak.testsuite; + +import org.eclipse.jetty.server.Handler; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.server.handler.HandlerCollection; +import org.eclipse.jetty.webapp.WebAppContext; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.ClassRule; +import org.junit.Rule; +import org.junit.Test; +import org.keycloak.models.KeycloakSession; +import org.keycloak.models.RealmModel; +import org.keycloak.services.managers.RealmManager; +import org.keycloak.testsuite.keycloaksaml.SamlAdapterTestStrategy; +import org.keycloak.testsuite.rule.AbstractKeycloakRule; +import org.openqa.selenium.WebDriver; + +import java.io.File; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; + +/** + * @author Stian Thorgersen + */ +public class JettySamlTest { + @Rule + public SamlAdapterTestStrategy testStrategy = new SamlAdapterTestStrategy("http://localhost:8081/auth", "http://localhost:8082", keycloakRule); + @ClassRule + public static AbstractKeycloakRule keycloakRule = new AbstractKeycloakRule() { + @Override + protected void configure(KeycloakSession session, RealmManager manager, RealmModel adminRealm) { + SamlAdapterTestStrategy.baseAdapterTestInitialization(session, manager, adminRealm, getClass()); + } + }; + + public static Server server = null; + + + @BeforeClass + public static void initJetty() throws Exception { + server = new Server(8082); + List list = new ArrayList(); + System.setProperty("app.server.base.url", "http://localhost:8082"); + System.setProperty("my.host.name", "localhost"); + URL dir = JettySamlTest.class.getResource("/keycloak-saml/testsaml.json"); + File base = new File(dir.getFile()).getParentFile(); + //list.add(new WebAppContext(new File(base, "customer-portal").toString(), "/customer-portal")); + list.add(new WebAppContext(new File(base, "simple-post").toString(), "/sales-post")); + list.add(new WebAppContext(new File(base, "simple-post2").toString(), "/sales-post2")); + list.add(new WebAppContext(new File(base, "simple-input").toString(), "/input-portal")); + list.add(new WebAppContext(new File(base, "signed-post").toString(), "/sales-post-sig")); + list.add(new WebAppContext(new File(base, "signed-post-email").toString(), "/sales-post-sig-email")); + list.add(new WebAppContext(new File(base, "signed-post-transient").toString(), "/sales-post-sig-transient")); + list.add(new WebAppContext(new File(base, "signed-post-persistent").toString(), "/sales-post-sig-persistent")); + list.add(new WebAppContext(new File(base, "signed-metadata").toString(), "/sales-metadata")); + list.add(new WebAppContext(new File(base, "signed-get").toString(), "/employee-sig")); + list.add(new WebAppContext(new File(base, "mappers").toString(), "/employee2")); + list.add(new WebAppContext(new File(base, "signed-front-get").toString(), "/employee-sig-front")); + list.add(new WebAppContext(new File(base, "bad-client-signed-post").toString(), "/bad-client-sales-post-sig")); + list.add(new WebAppContext(new File(base, "bad-realm-signed-post").toString(), "/bad-realm-sales-post-sig")); + list.add(new WebAppContext(new File(base, "encrypted-post").toString(), "/sales-post-enc")); + SamlAdapterTestStrategy.uploadSP("http://localhost:8081/auth"); + + + + HandlerCollection handlers = new HandlerCollection(); + handlers.setHandlers(list.toArray(new Handler[list.size()])); + server.setHandler(handlers); + + server.start(); + } + + + + @AfterClass + public static void shutdownJetty() throws Exception { + try { + server.stop(); + server.destroy(); + Thread.sleep(100); + } catch (Exception e) {} + } + + @Test + public void testSavedPostRequest() throws Exception { + testStrategy.testSavedPostRequest(); + } + @Test + public void testPostSimpleLoginLogoutIdpInitiatedRedirectTo() { + testStrategy.testPostSimpleLoginLogoutIdpInitiatedRedirectTo(); + } + + + @Test + public void testErrorHandlingSigned() throws Exception { + testStrategy.testErrorHandlingSigned(); + } + @Test + public void testErrorHandlingUnsigned() throws Exception { + testStrategy.testErrorHandlingUnsigned(); + } + + @Test + public void testPostSimpleLoginLogout() { + testStrategy.testPostSimpleLoginLogout(); + } + + @Test + public void testPostSimpleLoginLogoutIdpInitiated() { + testStrategy.testPostSimpleLoginLogoutIdpInitiated(); + } + + @Test + public void testPostSignedLoginLogout() { + testStrategy.testPostSignedLoginLogout(); + } + + @Test + public void testPostSignedLoginLogoutTransientNameID() { + testStrategy.testPostSignedLoginLogoutTransientNameID(); + } + + @Test + public void testPostSignedLoginLogoutPersistentNameID() { + testStrategy.testPostSignedLoginLogoutPersistentNameID(); + } + + @Test + public void testPostSignedLoginLogoutEmailNameID() { + testStrategy.testPostSignedLoginLogoutEmailNameID(); + } + + @Test + public void testAttributes() throws Exception { + testStrategy.testAttributes(); + } + + @Test + public void testRedirectSignedLoginLogout() { + testStrategy.testRedirectSignedLoginLogout(); + } + + @Test + public void testRedirectSignedLoginLogoutFrontNoSSO() { + testStrategy.testRedirectSignedLoginLogoutFrontNoSSO(); + } + + @Test + public void testRedirectSignedLoginLogoutFront() { + testStrategy.testRedirectSignedLoginLogoutFront(); + } + + @Test + public void testPostEncryptedLoginLogout() { + testStrategy.testPostEncryptedLoginLogout(); + } + + @Test + public void testPostBadClientSignature() { + testStrategy.testPostBadClientSignature(); + } + + @Test + public void testPostBadRealmSignature() { + testStrategy.testPostBadRealmSignature( ); + } + + @Test + public void testPostSimpleUnauthorized() { + testStrategy.testPostSimpleUnauthorized( new SamlAdapterTestStrategy.CheckAuthError() { + @Override + public void check(WebDriver driver) { + Assert.assertTrue(driver.getPageSource().contains("Error 403 !role")); + } + }); + } + + @Test + public void testMetadataPostSignedLoginLogout() throws Exception { + testStrategy.testMetadataPostSignedLoginLogout(); + } + + + +} diff --git a/testsuite/jetty/jetty94/src/test/resources/adapter-test/customer-db-error-page/WEB-INF/jetty-web.xml b/testsuite/jetty/jetty94/src/test/resources/adapter-test/customer-db-error-page/WEB-INF/jetty-web.xml new file mode 100644 index 0000000000..737eeb8bcf --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/adapter-test/customer-db-error-page/WEB-INF/jetty-web.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/adapter-test/customer-db-error-page/WEB-INF/keycloak.json b/testsuite/jetty/jetty94/src/test/resources/adapter-test/customer-db-error-page/WEB-INF/keycloak.json new file mode 100644 index 0000000000..38d1179399 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/adapter-test/customer-db-error-page/WEB-INF/keycloak.json @@ -0,0 +1,10 @@ +{ + "realm" : "demo", + "resource" : "customer-db", + "realm-public-key" : "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQAB", + "auth-server-url": "http://localhost:8081/auth", + "ssl-required" : "external", + "bearer-only" : true, + "enable-cors" : true + +} diff --git a/testsuite/jetty/jetty94/src/test/resources/adapter-test/customer-db-error-page/WEB-INF/web.xml b/testsuite/jetty/jetty94/src/test/resources/adapter-test/customer-db-error-page/WEB-INF/web.xml new file mode 100644 index 0000000000..b5e700aada --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/adapter-test/customer-db-error-page/WEB-INF/web.xml @@ -0,0 +1,96 @@ + + + + + + adapter-test + + + Servlet + org.keycloak.testsuite.adapter.CustomerDatabaseServlet + + + Error Servlet + org.keycloak.testsuite.rule.ErrorServlet + + + + Servlet + /* + + + + Error Servlet + /error.html + + + + 400 + /error.html + + + + 401 + /error.html + + + + 403 + /error.html + + + + 500 + /error.html + + + + + Users + /* + + + user + + + + + Errors + /error.html + + + + + FORM + demo + + /error.html + /error.html + + + + + admin + + + user + + diff --git a/testsuite/jetty/jetty94/src/test/resources/adapter-test/customer-db/WEB-INF/jetty-web.xml b/testsuite/jetty/jetty94/src/test/resources/adapter-test/customer-db/WEB-INF/jetty-web.xml new file mode 100644 index 0000000000..737eeb8bcf --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/adapter-test/customer-db/WEB-INF/jetty-web.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/adapter-test/customer-db/WEB-INF/keycloak.json b/testsuite/jetty/jetty94/src/test/resources/adapter-test/customer-db/WEB-INF/keycloak.json new file mode 100644 index 0000000000..38d1179399 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/adapter-test/customer-db/WEB-INF/keycloak.json @@ -0,0 +1,10 @@ +{ + "realm" : "demo", + "resource" : "customer-db", + "realm-public-key" : "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQAB", + "auth-server-url": "http://localhost:8081/auth", + "ssl-required" : "external", + "bearer-only" : true, + "enable-cors" : true + +} diff --git a/testsuite/jetty/jetty94/src/test/resources/adapter-test/customer-db/WEB-INF/web.xml b/testsuite/jetty/jetty94/src/test/resources/adapter-test/customer-db/WEB-INF/web.xml new file mode 100644 index 0000000000..81924fb852 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/adapter-test/customer-db/WEB-INF/web.xml @@ -0,0 +1,57 @@ + + + + + + adapter-test + + + Servlet + org.keycloak.testsuite.adapter.CustomerDatabaseServlet + + + + Servlet + /* + + + + + Users + /* + + + user + + + + + BASIC + demo + + + + admin + + + user + + diff --git a/testsuite/jetty/jetty94/src/test/resources/adapter-test/customer-portal/WEB-INF/jetty-web.xml b/testsuite/jetty/jetty94/src/test/resources/adapter-test/customer-portal/WEB-INF/jetty-web.xml new file mode 100644 index 0000000000..737eeb8bcf --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/adapter-test/customer-portal/WEB-INF/jetty-web.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/adapter-test/customer-portal/WEB-INF/keycloak.json b/testsuite/jetty/jetty94/src/test/resources/adapter-test/customer-portal/WEB-INF/keycloak.json new file mode 100644 index 0000000000..e9ad98722c --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/adapter-test/customer-portal/WEB-INF/keycloak.json @@ -0,0 +1,11 @@ +{ + "realm": "demo", + "resource": "customer-portal", + "realm-public-key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQAB", + "auth-server-url": "http://localhost:8081/auth", + "ssl-required" : "external", + "expose-token": true, + "credentials": { + "secret": "password" + } +} diff --git a/testsuite/jetty/jetty94/src/test/resources/adapter-test/customer-portal/WEB-INF/web.xml b/testsuite/jetty/jetty94/src/test/resources/adapter-test/customer-portal/WEB-INF/web.xml new file mode 100644 index 0000000000..8d05b6693c --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/adapter-test/customer-portal/WEB-INF/web.xml @@ -0,0 +1,76 @@ + + + + + + adapter-test + + + Servlet + org.keycloak.testsuite.adapter.CustomerServlet + + + Error Servlet + org.keycloak.testsuite.rule.ErrorServlet + + + + Servlet + /* + + + + Error Servlet + /error.html + + + + + Users + /* + + + user + + + + + Errors + /error.html + + + + + FORM + demo + + /error.html + /error.html + + + + + admin + + + user + + diff --git a/testsuite/jetty/jetty94/src/test/resources/adapter-test/demorealm.json b/testsuite/jetty/jetty94/src/test/resources/adapter-test/demorealm.json new file mode 100644 index 0000000000..b0a8888c0f --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/adapter-test/demorealm.json @@ -0,0 +1,164 @@ +{ + "id": "demo", + "realm": "demo", + "enabled": true, + "accessTokenLifespan": 3000, + "accessCodeLifespan": 10, + "accessCodeLifespanUserAction": 6000, + "sslRequired": "external", + "registrationAllowed": false, + "privateKey": "MIICXAIBAAKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQABAoGAfmO8gVhyBxdqlxmIuglbz8bcjQbhXJLR2EoS8ngTXmN1bo2L90M0mUKSdc7qF10LgETBzqL8jYlQIbt+e6TH8fcEpKCjUlyq0Mf/vVbfZSNaVycY13nTzo27iPyWQHK5NLuJzn1xvxxrUeXI6A2WFpGEBLbHjwpx5WQG9A+2scECQQDvdn9NE75HPTVPxBqsEd2z10TKkl9CZxu10Qby3iQQmWLEJ9LNmy3acvKrE3gMiYNWb6xHPKiIqOR1as7L24aTAkEAtyvQOlCvr5kAjVqrEKXalj0Tzewjweuxc0pskvArTI2Oo070h65GpoIKLc9jf+UA69cRtquwP93aZKtW06U8dQJAF2Y44ks/mK5+eyDqik3koCI08qaC8HYq2wVl7G2QkJ6sbAaILtcvD92ToOvyGyeE0flvmDZxMYlvaZnaQ0lcSQJBAKZU6umJi3/xeEbkJqMfeLclD27XGEFoPeNrmdx0q10Azp4NfJAY+Z8KRyQCR2BEG+oNitBOZ+YXF9KCpH3cdmECQHEigJhYg+ykOvr1aiZUMFT72HU0jnmQe2FVekuG+LJUt2Tm7GtMjTFoGpf0JwrVuZN39fOYAlo+nTixgeW7X8Y=", + "publicKey": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQAB", + "requiredCredentials": [ "password" ], + "users" : [ + { + "username" : "bburke@redhat.com", + "enabled": true, + "email" : "bburke@redhat.com", + "firstName": "Bill", + "lastName": "Burke", + "credentials" : [ + { "type" : "password", + "value" : "password" } + ], + "realmRoles": [ "user" ], + "applicationRoles": { + "account": [ "manage-account" ] + } + }, + { + "username" : "mposolda", + "enabled": true, + "email" : "mposolda@redhat.com", + "firstName": "Marek", + "lastName": "Posolda", + "credentials" : [ + { "type" : "password", + "value" : "password" } + ], + "realmRoles": [ "user" ], + "applicationRoles": { + "account": [ "manage-account" ] + } + } + ], + "roles" : { + "realm" : [ + { + "name": "user", + "description": "User privileges" + }, + { + "name": "admin", + "description": "Administrator privileges" + } + ] + }, + "scopeMappings": [ + { + "client": "third-party", + "roles": ["user"] + }, + { + "client": "customer-portal", + "roles": ["user"] + }, + { + "client": "product-portal", + "roles": ["user"] + } + + ], + "applications": [ + { + "name": "customer-portal", + "enabled": true, + "adminUrl": "http://localhost:8082/customer-portal", + "baseUrl": "http://localhost:8082/customer-portal", + "directAccessGrantsEnabled": true, + "redirectUris": [ + "http://localhost:8082/customer-portal/*" + ], + "secret": "password" + }, + { + "name": "customer-cookie-portal", + "enabled": true, + "baseUrl": "http://localhost:8082/customer-cookie-portal", + "redirectUris": [ + "http://localhost:8082/customer-cookie-portal/*" + ], + "secret": "password" + }, + { + "name": "customer-portal-js", + "enabled": true, + "publicClient": true, + "adminUrl": "http://localhost:8082/customer-portal-js", + "baseUrl": "http://localhost:8082/customer-portal-js", + "redirectUris": [ + "http://localhost:8080/customer-portal-js/*" + ] + }, + { + "name": "customer-portal-cli", + "enabled": true, + "publicClient": true, + "redirectUris": [ + "urn:ietf:wg:oauth:2.0:oob", + "http://localhost" + ] + }, + { + "name": "product-portal", + "enabled": true, + "adminUrl": "http://localhost:8082/product-portal", + "baseUrl": "http://localhost:8082/product-portal", + "redirectUris": [ + "http://localhost:8082/product-portal/*" + ], + "secret": "password" + }, + { + "name": "secure-portal", + "enabled": true, + "adminUrl": "http://localhost:8082/secure-portal", + "baseUrl": "http://localhost:8082/secure-portal", + "redirectUris": [ + "http://localhost:8082/secure-portal/*" + ], + "secret": "password" + }, + { + "name": "session-portal", + "enabled": true, + "adminUrl": "http://localhost:8082/session-portal", + "baseUrl": "http://localhost:8082/session-portal", + "redirectUris": [ + "http://localhost:8082/session-portal/*" + ], + "secret": "password" + }, + { + "name": "input-portal", + "enabled": true, + "adminUrl": "http://localhost:8082/input-portal", + "baseUrl": "http://localhost:8082/input-portal", + "redirectUris": [ + "http://localhost:8082/input-portal/*" + ], + "secret": "password" + } + ], + "oauthClients": [ + { + "name": "third-party", + "enabled": true, + "redirectUris": [ + "http://localhost:8082/oauth-client/*", + "http://localhost:8082/oauth-client-cdi/*" + ], + "secret": "password" + } + ] +} diff --git a/testsuite/jetty/jetty94/src/test/resources/adapter-test/input-portal/WEB-INF/jetty-web.xml b/testsuite/jetty/jetty94/src/test/resources/adapter-test/input-portal/WEB-INF/jetty-web.xml new file mode 100644 index 0000000000..737eeb8bcf --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/adapter-test/input-portal/WEB-INF/jetty-web.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/adapter-test/input-portal/WEB-INF/keycloak.json b/testsuite/jetty/jetty94/src/test/resources/adapter-test/input-portal/WEB-INF/keycloak.json new file mode 100644 index 0000000000..0b4b165302 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/adapter-test/input-portal/WEB-INF/keycloak.json @@ -0,0 +1,10 @@ +{ + "realm" : "demo", + "resource" : "input-portal", + "realm-public-key" : "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQAB", + "auth-server-url" : "http://${my.host.name}:8081/auth", + "ssl-required" : "external", + "credentials" : { + "secret": "password" + } +} \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/adapter-test/input-portal/WEB-INF/web.xml b/testsuite/jetty/jetty94/src/test/resources/adapter-test/input-portal/WEB-INF/web.xml new file mode 100644 index 0000000000..4ac67c46e1 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/adapter-test/input-portal/WEB-INF/web.xml @@ -0,0 +1,57 @@ + + + + + + adapter-test + + + Servlet + org.keycloak.testsuite.adapter.InputServlet + + + + Servlet + /* + + + + + Users + /secured/* + + + user + + + + + BASIC + demo + + + + admin + + + user + + diff --git a/testsuite/jetty/jetty94/src/test/resources/adapter-test/product-portal/WEB-INF/jetty-web.xml b/testsuite/jetty/jetty94/src/test/resources/adapter-test/product-portal/WEB-INF/jetty-web.xml new file mode 100644 index 0000000000..737eeb8bcf --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/adapter-test/product-portal/WEB-INF/jetty-web.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/adapter-test/product-portal/WEB-INF/keycloak.json b/testsuite/jetty/jetty94/src/test/resources/adapter-test/product-portal/WEB-INF/keycloak.json new file mode 100644 index 0000000000..3cfd478157 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/adapter-test/product-portal/WEB-INF/keycloak.json @@ -0,0 +1,10 @@ +{ + "realm" : "demo", + "resource" : "product-portal", + "realm-public-key" : "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQAB", + "auth-server-url" : "http://localhost:8081/auth", + "ssl-required" : "external", + "credentials" : { + "secret": "password" + } +} diff --git a/testsuite/jetty/jetty94/src/test/resources/adapter-test/product-portal/WEB-INF/web.xml b/testsuite/jetty/jetty94/src/test/resources/adapter-test/product-portal/WEB-INF/web.xml new file mode 100644 index 0000000000..59c6d3f7ae --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/adapter-test/product-portal/WEB-INF/web.xml @@ -0,0 +1,57 @@ + + + + + + adapter-test + + + Servlet + org.keycloak.testsuite.adapter.ProductServlet + + + + Servlet + /* + + + + + Users + /* + + + user + + + + + BASIC + demo + + + + admin + + + user + + diff --git a/testsuite/jetty/jetty94/src/test/resources/adapter-test/secure-portal/WEB-INF/jetty-web.xml b/testsuite/jetty/jetty94/src/test/resources/adapter-test/secure-portal/WEB-INF/jetty-web.xml new file mode 100644 index 0000000000..737eeb8bcf --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/adapter-test/secure-portal/WEB-INF/jetty-web.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/adapter-test/secure-portal/WEB-INF/keycloak.json b/testsuite/jetty/jetty94/src/test/resources/adapter-test/secure-portal/WEB-INF/keycloak.json new file mode 100644 index 0000000000..dd38f249c2 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/adapter-test/secure-portal/WEB-INF/keycloak.json @@ -0,0 +1,10 @@ +{ + "realm" : "demo", + "resource" : "secure-portal", + "realm-public-key" : "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQAB", + "auth-server-url" : "http://localhost:8080/auth", + "ssl-required" : "external", + "credentials" : { + "secret": "password" + } +} diff --git a/testsuite/jetty/jetty94/src/test/resources/adapter-test/secure-portal/WEB-INF/web.xml b/testsuite/jetty/jetty94/src/test/resources/adapter-test/secure-portal/WEB-INF/web.xml new file mode 100644 index 0000000000..859407b754 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/adapter-test/secure-portal/WEB-INF/web.xml @@ -0,0 +1,47 @@ + + + + + + adapter-test + + + Servlet + org.keycloak.testsuite.adapter.CallAuthenticatedServlet + + + + Servlet + /* + + + + BASIC + demo + + + + admin + + + user + + diff --git a/testsuite/jetty/jetty94/src/test/resources/adapter-test/session-portal/WEB-INF/jetty-web.xml b/testsuite/jetty/jetty94/src/test/resources/adapter-test/session-portal/WEB-INF/jetty-web.xml new file mode 100644 index 0000000000..737eeb8bcf --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/adapter-test/session-portal/WEB-INF/jetty-web.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/adapter-test/session-portal/WEB-INF/keycloak.json b/testsuite/jetty/jetty94/src/test/resources/adapter-test/session-portal/WEB-INF/keycloak.json new file mode 100644 index 0000000000..6a7f60b45c --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/adapter-test/session-portal/WEB-INF/keycloak.json @@ -0,0 +1,10 @@ +{ + "realm" : "demo", + "resource" : "session-portal", + "realm-public-key" : "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQAB", + "auth-server-url" : "http://${my.host.name}:8081/auth", + "ssl-required" : "external", + "credentials" : { + "secret": "password" + } +} \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/adapter-test/session-portal/WEB-INF/web.xml b/testsuite/jetty/jetty94/src/test/resources/adapter-test/session-portal/WEB-INF/web.xml new file mode 100644 index 0000000000..be1549fe74 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/adapter-test/session-portal/WEB-INF/web.xml @@ -0,0 +1,57 @@ + + + + + + adapter-test + + + Servlet + org.keycloak.testsuite.adapter.SessionServlet + + + + Servlet + /* + + + + + Users + /* + + + user + + + + + BASIC + demo + + + + admin + + + user + + diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/bad-client-signed-post/WEB-INF/jetty-web.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/bad-client-signed-post/WEB-INF/jetty-web.xml new file mode 100644 index 0000000000..c583350b79 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/bad-client-signed-post/WEB-INF/jetty-web.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/bad-client-signed-post/WEB-INF/keycloak-saml.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/bad-client-signed-post/WEB-INF/keycloak-saml.xml new file mode 100644 index 0000000000..a933bcb046 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/bad-client-signed-post/WEB-INF/keycloak-saml.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/bad-client-signed-post/WEB-INF/keystore.jks b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/bad-client-signed-post/WEB-INF/keystore.jks new file mode 100644 index 0000000000000000000000000000000000000000..6a3e3ba7d3be934b1f0c2c80f2a3e638a3fcc73a GIT binary patch literal 1739 zcmezO_TO6u1_mZ5W@IqPC@Cqh($~+)PfpCq$S*FjvM{hP)K5xG(M`_DOwB9NEl$iy zE!HgnO6eA7rt32>Fna1s?!F2%WS2n`(>4P>HZE;8MixdbCP79CL^0fB!0^ZoBE#s?YdggIu}v$_tBM#l2+{{vO53RX6!-pw0Sl;e9s> z`?8xa*2OK95{`1ZUd8?O(w~nkC$fd}b#3?R?74ngc4e*YyE<0U*5tj$9lPfre^9xZ zb6)E+hOcfbPw;VQOrL#bY2@eG$IoR-ieG;C>O_0vwM4#*>Gw@O|B24!+V+QYb*)%U zB5ThimUQ1cP8)WWn3pNsijZZ!?sInC?GNgTB7v<3lDZ$|t=oS1?DQSUN6dZ(I5=Fm zZ#w_iOA(ohr1wEgMK69BCH8&)q5V(V_;Q-cwt_&D2@fmMe~VAxkP>uPJnsAS$LXcd z=ChP2_}?m5%;)L5`B!H$Q&ru)Gl4CeJ{|dx`|VQt9cGoi{f36YlSI&b%=w^oJ!cj_@xt+1jjC<``-d4FQqkrDmGLH`lDiJ1KXOx;{P5b(#y8u! zOx(3TIBe;$-YokvY+1y%=Cv;v+X@&=3b*!|*zvG2ypfr8dddrhydrtIx$hbEA3Lb+ z^Ij0!18A%lE(cZrx zbW_PT3!&0bpUC4|cG>odu426Lv%c`iM(#r@C#M|wRi`<e#P2LW-C)Qzf4SK(cRsw`4gD_85vk3^h^ybfvk51O^mOAIGBkI zl(>Um8t}4lYPET^edlFl9WnmU3Il~ypiSrto7#bKE7+RW`8d*k( z^BTdp<_4Bglo{SQAK9(I{Kwqb%V5yh$<)}$Fm3khuh%Xp__aNnZ05!F^~5c|(>)dU zYy-5r?tkB=|Ech7=oE%_g#^i>g8c=b8pZ33b~}9y|0a;>6L`tdCX%Du-se_HbgyT-mgh$DHl|Q3;niKFe(5hFxFP+jrmip6(R2bM@;sFa5>rhEi7@xZ}jPU(bHK z-6QMr%C%uk(~z&N@k$Daz#z6RvxQ7*jeni>Yyt3<{550H@}1-*vsZ>QJqnjdJ>}CEocHxj|Ll;HHRit2<$bN| zODo?w+HHzcZ;Dtny{Mo&E}?A0rGxX`e%76{p8C<_lj%AWSFYxoLn|v;xE*rtMx6o| zek>`ex%tq->>45|Oa&%`i3W|oAt{0F6Poi4_zigtxFIP4YyxWR0;3ZtcFjzHv5TPr zUyQ8|+px~>f_5I;%rkov_sJS=*_T$l%fxK))w!)t^nS=3QrOOBbnI}nn?M$4X2Cnp zC8^Weo;@#eY_lo9>zx04&i{aeJ0@#8MoYw*1})cLxL{RqRL-&1nos9B;#HWKmT%Jg zYjVnN{-Wic{SuX)^NN3!?K9qHW-Y`RE+)t<+A{a6KCT#RkrVrQIOToQ#>IkF5$k1* z`KLc!y3EGhN;8G6{&h+J)#oNj+|TvA*(Elv3ooxsklgd^z`~`W!hX*`U;ew|ug49Y z+DYFSlb@CZFt%C`f|GqqQ-q)M$^t^B>=3@d!IlR|QT|V`mmF!Ooo}XR-bD`K; literal 0 HcmV?d00001 diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/bad-client-signed-post/WEB-INF/web.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/bad-client-signed-post/WEB-INF/web.xml new file mode 100644 index 0000000000..f1cdbea6a7 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/bad-client-signed-post/WEB-INF/web.xml @@ -0,0 +1,60 @@ + + + + + + adapter-test + + + SendUsernameServlet + org.keycloak.testsuite.keycloaksaml.SendUsernameServlet + + + SendUsernameServlet + /* + + + + + Users + /* + + + manager + + + + + BASIC + demo + + /error.html + /error.html + + + + + manager + + + el-jefe + + diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/bad-realm-signed-post/WEB-INF/jetty-web.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/bad-realm-signed-post/WEB-INF/jetty-web.xml new file mode 100644 index 0000000000..c583350b79 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/bad-realm-signed-post/WEB-INF/jetty-web.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/bad-realm-signed-post/WEB-INF/keycloak-saml.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/bad-realm-signed-post/WEB-INF/keycloak-saml.xml new file mode 100644 index 0000000000..6c0548ec6c --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/bad-realm-signed-post/WEB-INF/keycloak-saml.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/bad-realm-signed-post/WEB-INF/keystore.jks b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/bad-realm-signed-post/WEB-INF/keystore.jks new file mode 100644 index 0000000000000000000000000000000000000000..215384cdef8f651b392ec1ce469adffdb9e4a521 GIT binary patch literal 1715 zcmezO_TO6u1_mZ5W@OOMC@Cqh($~+)PfpCq$S*FjvM{hP)K5xG(Je|%%*oX)PRvOy z)-3?a=oV+D>oYJgdg`0JY6hCI)1ZlIs{tPymo^(C3!@g3AR{9y14|Rr!ngU6+@;2yEnn$CTh&C>rHT&=lxf7P=#(#EPPciy^NpNpfm&fy6 zyHq@QWgN7Quua3{_deg{5xT!T;gZa`ORyevO_>{(A?_lqLBk?tVwv zcw05^>a_ok{2o4|X}ww9d&8OTI&1rWOV}o*G;4YIABj?U{IX!F^}2T#k9r-Lx43t4 zQ}MGEKFMrHSIIbi`NFw8qTYK#;l|L+6G_!~Ze99NeR6}~B({al`YhKLe)`LEQRrFT zI??kV7ys(_Gp;rdEi+?(kYl*_{)B`XhP%wqZ|jP#(p9}*eJ-*oDJ$~t`8iuYbpKr8 z6ERK5=7)pJsncv*Ui>=Sy+-oq%Zeq3{C<3p>{zWB-*@PMv~;_~ehIyzqM#1~lg%nO zR3z>d&q_N!SG9DT%34*A@h*@U6*qn zHy^6Hte@wl)-yqsiJ6gs5!rdbKw}2Ft9#bDh1-g6C9hApR-N{BU2-$a@;~dg7G7KQ zQJ(SQaf$cVkLJ}o)C&BrQ}J_}Sd^S!pj9u%vFqgL#g4H*SOanK#kCk$R#$8fp=e2%%0nLGWF^C(9e+@>P#BW zdNL$zHF&ktAn>}*$#cAlQ?j&eY5qOdbG-`=RZ1|_=kVfH7Wht?MK{y+;BacmesiaSi9C`rL(tv zt7e>A!hGn3)+w + + + + + adapter-test + + + SendUsernameServlet + org.keycloak.testsuite.keycloaksaml.SendUsernameServlet + + + Error Servlet + org.keycloak.testsuite.rule.ErrorServlet + + + SendUsernameServlet + /* + + + + Error Servlet + /error.html + + + + 400 + /error.html + + + + 401 + /error.html + + + + 403 + /error.html + + + + 500 + /error.html + + + + Users + /* + + + manager + + + + + BASIC + demo + + /error.html + /error.html + + + + + manager + + + el-jefe + + diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/encrypted-post/WEB-INF/jetty-web.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/encrypted-post/WEB-INF/jetty-web.xml new file mode 100644 index 0000000000..c583350b79 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/encrypted-post/WEB-INF/jetty-web.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/encrypted-post/WEB-INF/keycloak-saml.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/encrypted-post/WEB-INF/keycloak-saml.xml new file mode 100644 index 0000000000..780843f80f --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/encrypted-post/WEB-INF/keycloak-saml.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/encrypted-post/WEB-INF/keystore.jks b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/encrypted-post/WEB-INF/keystore.jks new file mode 100644 index 0000000000000000000000000000000000000000..822162ceafcff816168fc3f807f89fd92b3a5b50 GIT binary patch literal 1707 zcmezO_TO6u1_mZ5W@J#!C@Cqh($~+)PfpCq$S*FjvM{hP&@WERNiEhb0P=NH^OE%$ z7#KYz6Cck2>fCM6#I)UjkBv*4jgf^>i%F1?k(Gg^iD_}UrK(uopPZv*t2wL8A259| zI`aN?JiEB@-|zCT62!dE<>@TxeEi#`qr%MakaWne8HuU8&Rf+!eJZ~A)@+%b=gTI3 z}t}Kh9&n=xJALY&1%rE5Xtj}?DT3ccM zzLjyk;p>IxtN$4~rTF4^4ps*5w|#qJs2RvHVwb2&4HHT}G6mX>j_ zB+o}SspL-?$AXY9wxY~mM~*v+D~M|>%H*l2iZEQN!al!g#~+h?y&1C}=&v$5_+O5# zR%d3~n;*41-+Z&%&i3i$*)(=Ral;#RLfz^&PQ6<Qk@kn?I8f zjIOE4xjuWt#>U7;qK%6d3)%2m14Fs+o7Q&E9j))cZvD$~6VY z`K(_`wXXQUxM_Mhr?CS~BYT&SjNF;a8)T1v<|-EnYKW znfn*>D>c8X3LLs5P1|ff&b-t-VNq&;?Vioj(ITpk3UflLeQh3Y6*TpjZ^9VuFHMb&eJmqcO-J4oF zbGD7s$43iWZ3{J-+7!AQT!5*bk%2Wr&(y#Y$hu+B#CQdWZJF4BsXJ^AhXF4er&gOs z+jm|@Ms8LH0|P@n106QzP!?uk;oH(zciJ^g^nW2f1fr(j^IIj_mYh+{=MTUuu z^O0Qz%xcVyy$lA8olK3547cC;aN0S}4X#t{Je7LzSJmIl-oix>zqec}-c+>ys(RVH z%*jd*@*R%6abo$sQfPD2n-yw*WGopk6&-$JdYffp?5A2WsirksU*>P)Yuy^;GoQJ7 z@}8NwKluez+rJxDUkvYCeEasf4VtEsceWo(l%IaPF2wP{WQH&M1AlD0;(AL+lZly; zff3nxz(8XLy31$n$L6n$@yBQXo_hZr(=E$&mcrE~rH(K5#ERZ8I&Z#b+bUs;BU`Pz zr8c>A&r6AWl)yGM&1vQb4o#I_oh|BOuXM~qyRWUTO*ItA>|5^}DX-3=CvY~Copog} z|N5DNGK~)=UHQ|pwxdD&?wy#ue6r zd2BP!>`mM!Yq(`!TJbIuv&C2Ewm#AOA#+G!JDbt5!_jU6S)7>#?>v{JPHTJiyvVW5 zru?pR{_i>e0}k$(tnC;r5oa2-Tz}z$Rl!j?$69MXo#%*GVPaaoN$;=8DZBZLmV5R~ zRC>-U{#CZmc$=BE5M#KQAhT%8+^_n$VvLhZT`uC}-UE*l?{^AlWvh6deKg5YY<{so z^Q;Vw9PO7U<@L_LnB4EW+5EY0g8J|5$c6=1gidY{vHttw(t18eyGrhp*H{h&Mm|5) z%XjibrSU~}U-!N`MaQ7}%Tf>4p1ZBL@64UmmXiN}_-uXncfFnNCXPLmB^?rPC~tmt e?8L6K8&o7B!`iO)afL5ud@^C)tPg?}*4Y3Vufd)G literal 0 HcmV?d00001 diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/encrypted-post/WEB-INF/web.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/encrypted-post/WEB-INF/web.xml new file mode 100644 index 0000000000..f1cdbea6a7 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/encrypted-post/WEB-INF/web.xml @@ -0,0 +1,60 @@ + + + + + + adapter-test + + + SendUsernameServlet + org.keycloak.testsuite.keycloaksaml.SendUsernameServlet + + + SendUsernameServlet + /* + + + + + Users + /* + + + manager + + + + + BASIC + demo + + /error.html + /error.html + + + + + manager + + + el-jefe + + diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/mappers/WEB-INF/jetty-web.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/mappers/WEB-INF/jetty-web.xml new file mode 100644 index 0000000000..c583350b79 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/mappers/WEB-INF/jetty-web.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/mappers/WEB-INF/keycloak-saml.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/mappers/WEB-INF/keycloak-saml.xml new file mode 100644 index 0000000000..e658934ba9 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/mappers/WEB-INF/keycloak-saml.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/mappers/WEB-INF/web.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/mappers/WEB-INF/web.xml new file mode 100644 index 0000000000..124a5ca25e --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/mappers/WEB-INF/web.xml @@ -0,0 +1,73 @@ + + + + + + adapter-test + + + SendUsernameServlet + org.keycloak.testsuite.keycloaksaml.SendUsernameServlet + + + SendUsernameServlet + /* + + + + + Users + /* + + + manager + el-jefe + + + + + BASIC + demo + + /error.html + /error.html + + + + + manager + + + el-jefe + + + user + + + employee + + + pee-on + + + hardcoded-role + + diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-front-get/WEB-INF/jetty-web.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-front-get/WEB-INF/jetty-web.xml new file mode 100644 index 0000000000..c583350b79 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-front-get/WEB-INF/jetty-web.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-front-get/WEB-INF/keycloak-saml.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-front-get/WEB-INF/keycloak-saml.xml new file mode 100644 index 0000000000..5f19f5bef3 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-front-get/WEB-INF/keycloak-saml.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-front-get/WEB-INF/keystore.jks b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-front-get/WEB-INF/keystore.jks new file mode 100644 index 0000000000000000000000000000000000000000..4daad218a3f78b798d1de8996c39014785c45c95 GIT binary patch literal 1701 zcmezO_TO6u1_mZ5W@J##C@Cqh($~+)PfpCq$S*FjvM{hP&`-@R$jPrvP1P;VOxI^% zVDyw<_*fUHZ?{1c({=+sHZE;8MixdbCP79uyORg)YY z9JblVoe37#<8yv++uHrwMt(`Nphxp#7ED_>S+vq3A$V?CM$x=F8~<1CpSc$wm(+Hu zz411`BD+=kz1b=gKRL;#`#Nn7@#d5Jgp zyU+bqJSg}`^iOo zwxaAnwr1v=(`8HSvI0&q#(LVmKj`48_o=|ZF~sUz-)ZfXQ}aKUYj?g;S+jPLZ2MC8 zEpA)iUwZXc@|w-v(2Mr_Po{d<9q;Y+%6pbo7@Xb3k?m22G3?fY_3W4Vb!TZxJxyW#iOp z^Jx3d%gD&h%3z>psAHhT#vIDREKE!$F_07IH8e3aFf=!`G&VN1h!W>Df^kiaEuu&^ zuW>%Ii-6gTxv`hQps|ywv5{flH`fH4sGK&FZJD+Uo@ZwH{aw0pZ*tSun_+&BMB=y^ z-c2e|JryhF@lboSqNJ$VMAPivsn=Wtr>-(y5UJYq_2(w@J=?sZzH4Uv+~XE=KG0oV z%k6FBuhuEy8?;t$$hlZO_hNdxV@r%s!{Sv3y`=Sau5!A_d*%0qkdsYQ+P9rwz|X|Y z$iRr~JYaw^1Kp*x$!6m!!+N$2U59F>+Ehlq%vy6f=7g$ll>JAT@7R&GCYog$eH$nhLh>b-VWDfl~L?*gnZUEWO_nVto$@tppcqEGenE`Oq>; z4-w&0fssAYpz$|2zEk#1MRUFZzag&yHzdBnCLl$q1u#O*5D{u&Y-(&4g{c8wjI9pa zu+Hy-b{^ZzGkX*F$r^6imsY&X#BA}^xvfw1e#jhB*v@8j>~OT3Ko)0a!8^|-sngn? zJuh->vnjvpod0{y|A2!#CTlxJOT?K5E!SVTU{!Eb&au{-Pv<$}RhXETZ_@i~a>{Q0 zqUE0b5|y6wihq^uGu~!qEyNfuCde$>GWV-Kt{Bt!8Ol`uIwkVrY6hQMG0Vc--|c@> z_11Di$61H3Yb+f~Hfi3Uxw>}!`N=XhR-HG~JPhu~3%XW))cNBg+UGy3J|?IC()^$P zzJ;ylddv2%TfF-1tBtIV-#1IRPC2=Ef||6-p*3ssE@!Cj<9MC20gXI3Dk|qo%RL%nc;dRUo literal 0 HcmV?d00001 diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-front-get/WEB-INF/web.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-front-get/WEB-INF/web.xml new file mode 100644 index 0000000000..f1cdbea6a7 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-front-get/WEB-INF/web.xml @@ -0,0 +1,60 @@ + + + + + + adapter-test + + + SendUsernameServlet + org.keycloak.testsuite.keycloaksaml.SendUsernameServlet + + + SendUsernameServlet + /* + + + + + Users + /* + + + manager + + + + + BASIC + demo + + /error.html + /error.html + + + + + manager + + + el-jefe + + diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-get/WEB-INF/jetty-web.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-get/WEB-INF/jetty-web.xml new file mode 100644 index 0000000000..c583350b79 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-get/WEB-INF/jetty-web.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-get/WEB-INF/keycloak-saml.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-get/WEB-INF/keycloak-saml.xml new file mode 100644 index 0000000000..6e76a0e7b4 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-get/WEB-INF/keycloak-saml.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-get/WEB-INF/keystore.jks b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-get/WEB-INF/keystore.jks new file mode 100644 index 0000000000000000000000000000000000000000..4daad218a3f78b798d1de8996c39014785c45c95 GIT binary patch literal 1701 zcmezO_TO6u1_mZ5W@J##C@Cqh($~+)PfpCq$S*FjvM{hP&`-@R$jPrvP1P;VOxI^% zVDyw<_*fUHZ?{1c({=+sHZE;8MixdbCP79uyORg)YY z9JblVoe37#<8yv++uHrwMt(`Nphxp#7ED_>S+vq3A$V?CM$x=F8~<1CpSc$wm(+Hu zz411`BD+=kz1b=gKRL;#`#Nn7@#d5Jgp zyU+bqJSg}`^iOo zwxaAnwr1v=(`8HSvI0&q#(LVmKj`48_o=|ZF~sUz-)ZfXQ}aKUYj?g;S+jPLZ2MC8 zEpA)iUwZXc@|w-v(2Mr_Po{d<9q;Y+%6pbo7@Xb3k?m22G3?fY_3W4Vb!TZxJxyW#iOp z^Jx3d%gD&h%3z>psAHhT#vIDREKE!$F_07IH8e3aFf=!`G&VN1h!W>Df^kiaEuu&^ zuW>%Ii-6gTxv`hQps|ywv5{flH`fH4sGK&FZJD+Uo@ZwH{aw0pZ*tSun_+&BMB=y^ z-c2e|JryhF@lboSqNJ$VMAPivsn=Wtr>-(y5UJYq_2(w@J=?sZzH4Uv+~XE=KG0oV z%k6FBuhuEy8?;t$$hlZO_hNdxV@r%s!{Sv3y`=Sau5!A_d*%0qkdsYQ+P9rwz|X|Y z$iRr~JYaw^1Kp*x$!6m!!+N$2U59F>+Ehlq%vy6f=7g$ll>JAT@7R&GCYog$eH$nhLh>b-VWDfl~L?*gnZUEWO_nVto$@tppcqEGenE`Oq>; z4-w&0fssAYpz$|2zEk#1MRUFZzag&yHzdBnCLl$q1u#O*5D{u&Y-(&4g{c8wjI9pa zu+Hy-b{^ZzGkX*F$r^6imsY&X#BA}^xvfw1e#jhB*v@8j>~OT3Ko)0a!8^|-sngn? zJuh->vnjvpod0{y|A2!#CTlxJOT?K5E!SVTU{!Eb&au{-Pv<$}RhXETZ_@i~a>{Q0 zqUE0b5|y6wihq^uGu~!qEyNfuCde$>GWV-Kt{Bt!8Ol`uIwkVrY6hQMG0Vc--|c@> z_11Di$61H3Yb+f~Hfi3Uxw>}!`N=XhR-HG~JPhu~3%XW))cNBg+UGy3J|?IC()^$P zzJ;ylddv2%TfF-1tBtIV-#1IRPC2=Ef||6-p*3ssE@!Cj<9MC20gXI3Dk|qo%RL%nc;dRUo literal 0 HcmV?d00001 diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-get/WEB-INF/web.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-get/WEB-INF/web.xml new file mode 100644 index 0000000000..42a7f774b5 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-get/WEB-INF/web.xml @@ -0,0 +1,88 @@ + + + + + + adapter-test + + + SendUsernameServlet + org.keycloak.testsuite.keycloaksaml.SendUsernameServlet + + + Error Servlet + org.keycloak.testsuite.rule.ErrorServlet + + + SendUsernameServlet + /* + + + + Error Servlet + /error.html + + + + 400 + /error.html + + + + 401 + /error.html + + + + 403 + /error.html + + + + 500 + /error.html + + + + Users + /* + + + manager + + + + + BASIC + demo + + /error.html + /error.html + + + + + manager + + + el-jefe + + diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-metadata/WEB-INF/jetty-web.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-metadata/WEB-INF/jetty-web.xml new file mode 100644 index 0000000000..c583350b79 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-metadata/WEB-INF/jetty-web.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-metadata/WEB-INF/keycloak-saml.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-metadata/WEB-INF/keycloak-saml.xml new file mode 100644 index 0000000000..1f52f1cb42 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-metadata/WEB-INF/keycloak-saml.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-metadata/WEB-INF/keystore.jks b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-metadata/WEB-INF/keystore.jks new file mode 100644 index 0000000000000000000000000000000000000000..144830bc77683d1d0a3d29f8793471d4f395bdb0 GIT binary patch literal 1705 zcmezO_TO6u1_mZ5W@J#!C@Cqh($~+)PfpCq$S*FjvM{hP&@WERNiEhb0P=N1M z7#KYz`B=UJb?!81V%loJ$Ht}2#>m2`#U#kc$jZRd#I(>@`_HHQr3*BE{x`hDyEHld z+K~ja7y5T|r=%}Fu;`1zi=v(re>&z=o_dkol)j+zYO>t=Qy1S}v3en%vP3563G;>m zf%$6H#y=LWo_E+v&g1u@xzTso16CaPbkO_D8o@;(`MobV^Igq3BNxZ5w|jA2W>>?O zsK)o5D^C2naN_4wlZOiFZx$ZYW2t4}JhWx=_GhgLGruICtx3+%d3V!9>Dt7nXAhlc z$;{X;mJr8NzU5%3ud}q*;Tc<&7_HRg&F#_Q?wWFKHOG|)@xdBe`K>+ek+V}K-){E) zl)cDAKzFrg_KD*rPhJ#0xY%188oeS%DBgct!6JRDwVn#urq)k%GX7O$-%BXGHp?M$ zPK(%~JsS=itGtnGNeXRIJS=enoqTH}>U?=&w0Rv-!V zt0IaI7=L{C`R*=P35_m^|6)DbnI1Rom?{^itz&v>PMs${YwWF4+mV{{ zB3p#_4CDJAHQ!e4#HZJ%dA%($R{WrMXd~~o9sJ4l4<@p_UZ&<;=%+j9w)>u?FXr2x z;Qi$;R(a*~n?JwFjfqj;bam5w#iu)2cStlBuRNH-DYCa*SFTj`Ruc2O%^{1v zS^p3Un$kT>@>nGEyG?KA#5`*A-Q)TDd5mCQN4nqL|I4L=R^IMCEM*}Xua~%r;rLwD z(rqehS=sAVMB2P;SIyh9w+fi%85vk3^h^ybfvg(_O^jE7*p`Wn(Np4IY>ELd8>d#A zN85K^Mn-N{1_J{_Jp&y!=1>-9Vd650ft)z6p^2e^p_!qPiHVVMlsK;ujB93K97TqS zjq{OR1z|$TGQU@sN$9wB)LN$MwU<2= zd)SlRE7$3UyG=O%*+B2uv-3&H4597J6WaBsZpb_&f7j)l$IXYTF6-xcsr5`yWnyMz zU_^EvFwmHR?&_X(ZsE4#TgmHFu2rXfU6s0)lCKe^<7iiUsaqK$zd9h>c57vO3iO-78%EoLL<8ZmZxNJeq&U-KBw5j(T{eI-t zj}(o0{2w&pRSxr|MK;+T;phADf{DX@d*|wohzX72{tZ3*&sbbC2N!KDDXF>n@KOsN z=~ICbKGC4@Hz>{}*<-lToNvHy$ZNn2iF2?C$Wdx)Vu&22rlzLAD8`N=&Wn#AY>fF{RdOu_iDQssmI(9hPO(2Uiv*4ZQlGJH!&z=`K zw%L^5bkqb1@@gO=+rT(BxQD(6^h&8PDm@hVJA%Qxx$H92KBf6;Q! zeu+xYdBwlV_8D(8vle0u7ZYR_ZJGO3A6Ja^r!9<;Jf^6B_V*`!pI4_%{2#46Qrcoa z{d4O3!wr>pceY+y88$ipliuM2X9G4KozS*BUZS)4a=%Gc^OV}R*}*rh8m{{;m0Oa) z^Ysn?xlP?KeF94gT3Fr`zuJ}MUVH6cw8xR2&A~UG*V~pyDQR4_ymoT_iPrx=pDW$^ gV7obl)$b?cUQd>i8HM*{tk@@=IXfvlri|w}0JG8182|tP literal 0 HcmV?d00001 diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-metadata/WEB-INF/web.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-metadata/WEB-INF/web.xml new file mode 100644 index 0000000000..f1cdbea6a7 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-metadata/WEB-INF/web.xml @@ -0,0 +1,60 @@ + + + + + + adapter-test + + + SendUsernameServlet + org.keycloak.testsuite.keycloaksaml.SendUsernameServlet + + + SendUsernameServlet + /* + + + + + Users + /* + + + manager + + + + + BASIC + demo + + /error.html + /error.html + + + + + manager + + + el-jefe + + diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-email/WEB-INF/jetty-web.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-email/WEB-INF/jetty-web.xml new file mode 100644 index 0000000000..c583350b79 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-email/WEB-INF/jetty-web.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-email/WEB-INF/keycloak-saml.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-email/WEB-INF/keycloak-saml.xml new file mode 100644 index 0000000000..a53b44dc2f --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-email/WEB-INF/keycloak-saml.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-email/WEB-INF/keystore.jks b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-email/WEB-INF/keystore.jks new file mode 100644 index 0000000000000000000000000000000000000000..144830bc77683d1d0a3d29f8793471d4f395bdb0 GIT binary patch literal 1705 zcmezO_TO6u1_mZ5W@J#!C@Cqh($~+)PfpCq$S*FjvM{hP&@WERNiEhb0P=N1M z7#KYz`B=UJb?!81V%loJ$Ht}2#>m2`#U#kc$jZRd#I(>@`_HHQr3*BE{x`hDyEHld z+K~ja7y5T|r=%}Fu;`1zi=v(re>&z=o_dkol)j+zYO>t=Qy1S}v3en%vP3563G;>m zf%$6H#y=LWo_E+v&g1u@xzTso16CaPbkO_D8o@;(`MobV^Igq3BNxZ5w|jA2W>>?O zsK)o5D^C2naN_4wlZOiFZx$ZYW2t4}JhWx=_GhgLGruICtx3+%d3V!9>Dt7nXAhlc z$;{X;mJr8NzU5%3ud}q*;Tc<&7_HRg&F#_Q?wWFKHOG|)@xdBe`K>+ek+V}K-){E) zl)cDAKzFrg_KD*rPhJ#0xY%188oeS%DBgct!6JRDwVn#urq)k%GX7O$-%BXGHp?M$ zPK(%~JsS=itGtnGNeXRIJS=enoqTH}>U?=&w0Rv-!V zt0IaI7=L{C`R*=P35_m^|6)DbnI1Rom?{^itz&v>PMs${YwWF4+mV{{ zB3p#_4CDJAHQ!e4#HZJ%dA%($R{WrMXd~~o9sJ4l4<@p_UZ&<;=%+j9w)>u?FXr2x z;Qi$;R(a*~n?JwFjfqj;bam5w#iu)2cStlBuRNH-DYCa*SFTj`Ruc2O%^{1v zS^p3Un$kT>@>nGEyG?KA#5`*A-Q)TDd5mCQN4nqL|I4L=R^IMCEM*}Xua~%r;rLwD z(rqehS=sAVMB2P;SIyh9w+fi%85vk3^h^ybfvg(_O^jE7*p`Wn(Np4IY>ELd8>d#A zN85K^Mn-N{1_J{_Jp&y!=1>-9Vd650ft)z6p^2e^p_!qPiHVVMlsK;ujB93K97TqS zjq{OR1z|$TGQU@sN$9wB)LN$MwU<2= zd)SlRE7$3UyG=O%*+B2uv-3&H4597J6WaBsZpb_&f7j)l$IXYTF6-xcsr5`yWnyMz zU_^EvFwmHR?&_X(ZsE4#TgmHFu2rXfU6s0)lCKe^<7iiUsaqK$zd9h>c57vO3iO-78%EoLL<8ZmZxNJeq&U-KBw5j(T{eI-t zj}(o0{2w&pRSxr|MK;+T;phADf{DX@d*|wohzX72{tZ3*&sbbC2N!KDDXF>n@KOsN z=~ICbKGC4@Hz>{}*<-lToNvHy$ZNn2iF2?C$Wdx)Vu&22rlzLAD8`N=&Wn#AY>fF{RdOu_iDQssmI(9hPO(2Uiv*4ZQlGJH!&z=`K zw%L^5bkqb1@@gO=+rT(BxQD(6^h&8PDm@hVJA%Qxx$H92KBf6;Q! zeu+xYdBwlV_8D(8vle0u7ZYR_ZJGO3A6Ja^r!9<;Jf^6B_V*`!pI4_%{2#46Qrcoa z{d4O3!wr>pceY+y88$ipliuM2X9G4KozS*BUZS)4a=%Gc^OV}R*}*rh8m{{;m0Oa) z^Ysn?xlP?KeF94gT3Fr`zuJ}MUVH6cw8xR2&A~UG*V~pyDQR4_ymoT_iPrx=pDW$^ gV7obl)$b?cUQd>i8HM*{tk@@=IXfvlri|w}0JG8182|tP literal 0 HcmV?d00001 diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-email/WEB-INF/web.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-email/WEB-INF/web.xml new file mode 100644 index 0000000000..f1cdbea6a7 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-email/WEB-INF/web.xml @@ -0,0 +1,60 @@ + + + + + + adapter-test + + + SendUsernameServlet + org.keycloak.testsuite.keycloaksaml.SendUsernameServlet + + + SendUsernameServlet + /* + + + + + Users + /* + + + manager + + + + + BASIC + demo + + /error.html + /error.html + + + + + manager + + + el-jefe + + diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-persistent/WEB-INF/jetty-web.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-persistent/WEB-INF/jetty-web.xml new file mode 100644 index 0000000000..c583350b79 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-persistent/WEB-INF/jetty-web.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-persistent/WEB-INF/keycloak-saml.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-persistent/WEB-INF/keycloak-saml.xml new file mode 100644 index 0000000000..a4bf71bc2d --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-persistent/WEB-INF/keycloak-saml.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-persistent/WEB-INF/keystore.jks b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-persistent/WEB-INF/keystore.jks new file mode 100644 index 0000000000000000000000000000000000000000..144830bc77683d1d0a3d29f8793471d4f395bdb0 GIT binary patch literal 1705 zcmezO_TO6u1_mZ5W@J#!C@Cqh($~+)PfpCq$S*FjvM{hP&@WERNiEhb0P=N1M z7#KYz`B=UJb?!81V%loJ$Ht}2#>m2`#U#kc$jZRd#I(>@`_HHQr3*BE{x`hDyEHld z+K~ja7y5T|r=%}Fu;`1zi=v(re>&z=o_dkol)j+zYO>t=Qy1S}v3en%vP3563G;>m zf%$6H#y=LWo_E+v&g1u@xzTso16CaPbkO_D8o@;(`MobV^Igq3BNxZ5w|jA2W>>?O zsK)o5D^C2naN_4wlZOiFZx$ZYW2t4}JhWx=_GhgLGruICtx3+%d3V!9>Dt7nXAhlc z$;{X;mJr8NzU5%3ud}q*;Tc<&7_HRg&F#_Q?wWFKHOG|)@xdBe`K>+ek+V}K-){E) zl)cDAKzFrg_KD*rPhJ#0xY%188oeS%DBgct!6JRDwVn#urq)k%GX7O$-%BXGHp?M$ zPK(%~JsS=itGtnGNeXRIJS=enoqTH}>U?=&w0Rv-!V zt0IaI7=L{C`R*=P35_m^|6)DbnI1Rom?{^itz&v>PMs${YwWF4+mV{{ zB3p#_4CDJAHQ!e4#HZJ%dA%($R{WrMXd~~o9sJ4l4<@p_UZ&<;=%+j9w)>u?FXr2x z;Qi$;R(a*~n?JwFjfqj;bam5w#iu)2cStlBuRNH-DYCa*SFTj`Ruc2O%^{1v zS^p3Un$kT>@>nGEyG?KA#5`*A-Q)TDd5mCQN4nqL|I4L=R^IMCEM*}Xua~%r;rLwD z(rqehS=sAVMB2P;SIyh9w+fi%85vk3^h^ybfvg(_O^jE7*p`Wn(Np4IY>ELd8>d#A zN85K^Mn-N{1_J{_Jp&y!=1>-9Vd650ft)z6p^2e^p_!qPiHVVMlsK;ujB93K97TqS zjq{OR1z|$TGQU@sN$9wB)LN$MwU<2= zd)SlRE7$3UyG=O%*+B2uv-3&H4597J6WaBsZpb_&f7j)l$IXYTF6-xcsr5`yWnyMz zU_^EvFwmHR?&_X(ZsE4#TgmHFu2rXfU6s0)lCKe^<7iiUsaqK$zd9h>c57vO3iO-78%EoLL<8ZmZxNJeq&U-KBw5j(T{eI-t zj}(o0{2w&pRSxr|MK;+T;phADf{DX@d*|wohzX72{tZ3*&sbbC2N!KDDXF>n@KOsN z=~ICbKGC4@Hz>{}*<-lToNvHy$ZNn2iF2?C$Wdx)Vu&22rlzLAD8`N=&Wn#AY>fF{RdOu_iDQssmI(9hPO(2Uiv*4ZQlGJH!&z=`K zw%L^5bkqb1@@gO=+rT(BxQD(6^h&8PDm@hVJA%Qxx$H92KBf6;Q! zeu+xYdBwlV_8D(8vle0u7ZYR_ZJGO3A6Ja^r!9<;Jf^6B_V*`!pI4_%{2#46Qrcoa z{d4O3!wr>pceY+y88$ipliuM2X9G4KozS*BUZS)4a=%Gc^OV}R*}*rh8m{{;m0Oa) z^Ysn?xlP?KeF94gT3Fr`zuJ}MUVH6cw8xR2&A~UG*V~pyDQR4_ymoT_iPrx=pDW$^ gV7obl)$b?cUQd>i8HM*{tk@@=IXfvlri|w}0JG8182|tP literal 0 HcmV?d00001 diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-persistent/WEB-INF/web.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-persistent/WEB-INF/web.xml new file mode 100644 index 0000000000..f1cdbea6a7 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-persistent/WEB-INF/web.xml @@ -0,0 +1,60 @@ + + + + + + adapter-test + + + SendUsernameServlet + org.keycloak.testsuite.keycloaksaml.SendUsernameServlet + + + SendUsernameServlet + /* + + + + + Users + /* + + + manager + + + + + BASIC + demo + + /error.html + /error.html + + + + + manager + + + el-jefe + + diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-transient/WEB-INF/jetty-web.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-transient/WEB-INF/jetty-web.xml new file mode 100644 index 0000000000..c583350b79 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-transient/WEB-INF/jetty-web.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-transient/WEB-INF/keycloak-saml.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-transient/WEB-INF/keycloak-saml.xml new file mode 100644 index 0000000000..8bf32fa61f --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-transient/WEB-INF/keycloak-saml.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-transient/WEB-INF/keystore.jks b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-transient/WEB-INF/keystore.jks new file mode 100644 index 0000000000000000000000000000000000000000..144830bc77683d1d0a3d29f8793471d4f395bdb0 GIT binary patch literal 1705 zcmezO_TO6u1_mZ5W@J#!C@Cqh($~+)PfpCq$S*FjvM{hP&@WERNiEhb0P=N1M z7#KYz`B=UJb?!81V%loJ$Ht}2#>m2`#U#kc$jZRd#I(>@`_HHQr3*BE{x`hDyEHld z+K~ja7y5T|r=%}Fu;`1zi=v(re>&z=o_dkol)j+zYO>t=Qy1S}v3en%vP3563G;>m zf%$6H#y=LWo_E+v&g1u@xzTso16CaPbkO_D8o@;(`MobV^Igq3BNxZ5w|jA2W>>?O zsK)o5D^C2naN_4wlZOiFZx$ZYW2t4}JhWx=_GhgLGruICtx3+%d3V!9>Dt7nXAhlc z$;{X;mJr8NzU5%3ud}q*;Tc<&7_HRg&F#_Q?wWFKHOG|)@xdBe`K>+ek+V}K-){E) zl)cDAKzFrg_KD*rPhJ#0xY%188oeS%DBgct!6JRDwVn#urq)k%GX7O$-%BXGHp?M$ zPK(%~JsS=itGtnGNeXRIJS=enoqTH}>U?=&w0Rv-!V zt0IaI7=L{C`R*=P35_m^|6)DbnI1Rom?{^itz&v>PMs${YwWF4+mV{{ zB3p#_4CDJAHQ!e4#HZJ%dA%($R{WrMXd~~o9sJ4l4<@p_UZ&<;=%+j9w)>u?FXr2x z;Qi$;R(a*~n?JwFjfqj;bam5w#iu)2cStlBuRNH-DYCa*SFTj`Ruc2O%^{1v zS^p3Un$kT>@>nGEyG?KA#5`*A-Q)TDd5mCQN4nqL|I4L=R^IMCEM*}Xua~%r;rLwD z(rqehS=sAVMB2P;SIyh9w+fi%85vk3^h^ybfvg(_O^jE7*p`Wn(Np4IY>ELd8>d#A zN85K^Mn-N{1_J{_Jp&y!=1>-9Vd650ft)z6p^2e^p_!qPiHVVMlsK;ujB93K97TqS zjq{OR1z|$TGQU@sN$9wB)LN$MwU<2= zd)SlRE7$3UyG=O%*+B2uv-3&H4597J6WaBsZpb_&f7j)l$IXYTF6-xcsr5`yWnyMz zU_^EvFwmHR?&_X(ZsE4#TgmHFu2rXfU6s0)lCKe^<7iiUsaqK$zd9h>c57vO3iO-78%EoLL<8ZmZxNJeq&U-KBw5j(T{eI-t zj}(o0{2w&pRSxr|MK;+T;phADf{DX@d*|wohzX72{tZ3*&sbbC2N!KDDXF>n@KOsN z=~ICbKGC4@Hz>{}*<-lToNvHy$ZNn2iF2?C$Wdx)Vu&22rlzLAD8`N=&Wn#AY>fF{RdOu_iDQssmI(9hPO(2Uiv*4ZQlGJH!&z=`K zw%L^5bkqb1@@gO=+rT(BxQD(6^h&8PDm@hVJA%Qxx$H92KBf6;Q! zeu+xYdBwlV_8D(8vle0u7ZYR_ZJGO3A6Ja^r!9<;Jf^6B_V*`!pI4_%{2#46Qrcoa z{d4O3!wr>pceY+y88$ipliuM2X9G4KozS*BUZS)4a=%Gc^OV}R*}*rh8m{{;m0Oa) z^Ysn?xlP?KeF94gT3Fr`zuJ}MUVH6cw8xR2&A~UG*V~pyDQR4_ymoT_iPrx=pDW$^ gV7obl)$b?cUQd>i8HM*{tk@@=IXfvlri|w}0JG8182|tP literal 0 HcmV?d00001 diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-transient/WEB-INF/web.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-transient/WEB-INF/web.xml new file mode 100644 index 0000000000..f1cdbea6a7 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post-transient/WEB-INF/web.xml @@ -0,0 +1,60 @@ + + + + + + adapter-test + + + SendUsernameServlet + org.keycloak.testsuite.keycloaksaml.SendUsernameServlet + + + SendUsernameServlet + /* + + + + + Users + /* + + + manager + + + + + BASIC + demo + + /error.html + /error.html + + + + + manager + + + el-jefe + + diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post/WEB-INF/jetty-web.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post/WEB-INF/jetty-web.xml new file mode 100644 index 0000000000..c583350b79 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post/WEB-INF/jetty-web.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post/WEB-INF/keycloak-saml.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post/WEB-INF/keycloak-saml.xml new file mode 100644 index 0000000000..0cae188229 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post/WEB-INF/keycloak-saml.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post/WEB-INF/keystore.jks b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post/WEB-INF/keystore.jks new file mode 100644 index 0000000000000000000000000000000000000000..144830bc77683d1d0a3d29f8793471d4f395bdb0 GIT binary patch literal 1705 zcmezO_TO6u1_mZ5W@J#!C@Cqh($~+)PfpCq$S*FjvM{hP&@WERNiEhb0P=N1M z7#KYz`B=UJb?!81V%loJ$Ht}2#>m2`#U#kc$jZRd#I(>@`_HHQr3*BE{x`hDyEHld z+K~ja7y5T|r=%}Fu;`1zi=v(re>&z=o_dkol)j+zYO>t=Qy1S}v3en%vP3563G;>m zf%$6H#y=LWo_E+v&g1u@xzTso16CaPbkO_D8o@;(`MobV^Igq3BNxZ5w|jA2W>>?O zsK)o5D^C2naN_4wlZOiFZx$ZYW2t4}JhWx=_GhgLGruICtx3+%d3V!9>Dt7nXAhlc z$;{X;mJr8NzU5%3ud}q*;Tc<&7_HRg&F#_Q?wWFKHOG|)@xdBe`K>+ek+V}K-){E) zl)cDAKzFrg_KD*rPhJ#0xY%188oeS%DBgct!6JRDwVn#urq)k%GX7O$-%BXGHp?M$ zPK(%~JsS=itGtnGNeXRIJS=enoqTH}>U?=&w0Rv-!V zt0IaI7=L{C`R*=P35_m^|6)DbnI1Rom?{^itz&v>PMs${YwWF4+mV{{ zB3p#_4CDJAHQ!e4#HZJ%dA%($R{WrMXd~~o9sJ4l4<@p_UZ&<;=%+j9w)>u?FXr2x z;Qi$;R(a*~n?JwFjfqj;bam5w#iu)2cStlBuRNH-DYCa*SFTj`Ruc2O%^{1v zS^p3Un$kT>@>nGEyG?KA#5`*A-Q)TDd5mCQN4nqL|I4L=R^IMCEM*}Xua~%r;rLwD z(rqehS=sAVMB2P;SIyh9w+fi%85vk3^h^ybfvg(_O^jE7*p`Wn(Np4IY>ELd8>d#A zN85K^Mn-N{1_J{_Jp&y!=1>-9Vd650ft)z6p^2e^p_!qPiHVVMlsK;ujB93K97TqS zjq{OR1z|$TGQU@sN$9wB)LN$MwU<2= zd)SlRE7$3UyG=O%*+B2uv-3&H4597J6WaBsZpb_&f7j)l$IXYTF6-xcsr5`yWnyMz zU_^EvFwmHR?&_X(ZsE4#TgmHFu2rXfU6s0)lCKe^<7iiUsaqK$zd9h>c57vO3iO-78%EoLL<8ZmZxNJeq&U-KBw5j(T{eI-t zj}(o0{2w&pRSxr|MK;+T;phADf{DX@d*|wohzX72{tZ3*&sbbC2N!KDDXF>n@KOsN z=~ICbKGC4@Hz>{}*<-lToNvHy$ZNn2iF2?C$Wdx)Vu&22rlzLAD8`N=&Wn#AY>fF{RdOu_iDQssmI(9hPO(2Uiv*4ZQlGJH!&z=`K zw%L^5bkqb1@@gO=+rT(BxQD(6^h&8PDm@hVJA%Qxx$H92KBf6;Q! zeu+xYdBwlV_8D(8vle0u7ZYR_ZJGO3A6Ja^r!9<;Jf^6B_V*`!pI4_%{2#46Qrcoa z{d4O3!wr>pceY+y88$ipliuM2X9G4KozS*BUZS)4a=%Gc^OV}R*}*rh8m{{;m0Oa) z^Ysn?xlP?KeF94gT3Fr`zuJ}MUVH6cw8xR2&A~UG*V~pyDQR4_ymoT_iPrx=pDW$^ gV7obl)$b?cUQd>i8HM*{tk@@=IXfvlri|w}0JG8182|tP literal 0 HcmV?d00001 diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post/WEB-INF/web.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post/WEB-INF/web.xml new file mode 100644 index 0000000000..f1cdbea6a7 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/signed-post/WEB-INF/web.xml @@ -0,0 +1,60 @@ + + + + + + adapter-test + + + SendUsernameServlet + org.keycloak.testsuite.keycloaksaml.SendUsernameServlet + + + SendUsernameServlet + /* + + + + + Users + /* + + + manager + + + + + BASIC + demo + + /error.html + /error.html + + + + + manager + + + el-jefe + + diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/simple-input/WEB-INF/jetty-web.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/simple-input/WEB-INF/jetty-web.xml new file mode 100644 index 0000000000..c583350b79 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/simple-input/WEB-INF/jetty-web.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/simple-input/WEB-INF/keycloak-saml.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/simple-input/WEB-INF/keycloak-saml.xml new file mode 100644 index 0000000000..8cf6d987e0 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/simple-input/WEB-INF/keycloak-saml.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/simple-input/WEB-INF/web.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/simple-input/WEB-INF/web.xml new file mode 100644 index 0000000000..0be7a7439e --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/simple-input/WEB-INF/web.xml @@ -0,0 +1,60 @@ + + + + + + adapter-test + + + SendUsernameServlet + org.keycloak.testsuite.keycloaksaml.InputServlet + + + SendUsernameServlet + /* + + + + + Users + /secured/* + + + manager + + + + + BASIC + demo + + /error.html + /error.html + + + + + manager + + + el-jefe + + diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/simple-post/WEB-INF/jetty-web.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/simple-post/WEB-INF/jetty-web.xml new file mode 100644 index 0000000000..c583350b79 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/simple-post/WEB-INF/jetty-web.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/simple-post/WEB-INF/keycloak-saml.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/simple-post/WEB-INF/keycloak-saml.xml new file mode 100644 index 0000000000..716be6779d --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/simple-post/WEB-INF/keycloak-saml.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/simple-post/WEB-INF/web.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/simple-post/WEB-INF/web.xml new file mode 100644 index 0000000000..f1cdbea6a7 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/simple-post/WEB-INF/web.xml @@ -0,0 +1,60 @@ + + + + + + adapter-test + + + SendUsernameServlet + org.keycloak.testsuite.keycloaksaml.SendUsernameServlet + + + SendUsernameServlet + /* + + + + + Users + /* + + + manager + + + + + BASIC + demo + + /error.html + /error.html + + + + + manager + + + el-jefe + + diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/simple-post2/WEB-INF/jetty-web.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/simple-post2/WEB-INF/jetty-web.xml new file mode 100644 index 0000000000..c583350b79 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/simple-post2/WEB-INF/jetty-web.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/simple-post2/WEB-INF/keycloak-saml.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/simple-post2/WEB-INF/keycloak-saml.xml new file mode 100644 index 0000000000..a09f312986 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/simple-post2/WEB-INF/keycloak-saml.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/simple-post2/WEB-INF/web.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/simple-post2/WEB-INF/web.xml new file mode 100644 index 0000000000..f1cdbea6a7 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/simple-post2/WEB-INF/web.xml @@ -0,0 +1,60 @@ + + + + + + adapter-test + + + SendUsernameServlet + org.keycloak.testsuite.keycloaksaml.SendUsernameServlet + + + SendUsernameServlet + /* + + + + + Users + /* + + + manager + + + + + BASIC + demo + + /error.html + /error.html + + + + + manager + + + el-jefe + + diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/sp-metadata.xml b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/sp-metadata.xml new file mode 100644 index 0000000000..853a6b2d41 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/sp-metadata.xml @@ -0,0 +1,55 @@ + + + + + + + urn:oasis:names:tc:SAML:2.0:nameid-format:transient + + + + + + + + MIIB1DCCAT0CBgFJGP5dZDANBgkqhkiG9w0BAQsFADAwMS4wLAYDVQQDEyVodHRwOi8vbG9jYWxob3N0OjgwODAvc2FsZXMtcG9zdC1zaWcvMB4XDTE0MTAxNjEyNDQyM1oXDTI0MTAxNjEyNDYwM1owMDEuMCwGA1UEAxMlaHR0cDovL2xvY2FsaG9zdDo4MDgwL3NhbGVzLXBvc3Qtc2lnLzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA1RvGu8RjemSJA23nnMksoHA37MqY1DDTxOECY4rPAd9egr7GUNIXE0y1MokaR5R2crNpN8RIRwR8phQtQDjXL82c6W+NLQISxztarQJ7rdNJIYwHY0d5ri1XRpDP8zAuxubPYiMAVYcDkIcvlbBpwh/dRM5I2eElRK+eSiaMkCUCAwEAATANBgkqhkiG9w0BAQsFAAOBgQCLms6htnPaY69k1ntm9a5jgwSn/K61cdai8R8B0ccY7zvinn9AfRD7fiROQpFyY29wKn8WCLrJ86NBXfgFUGyR5nLNHVy3FghE36N2oHy53uichieMxffE6vhkKJ4P8ChfJMMOZlmCPsQPDvjoAghHt4mriFiQgRdPgIy/zDjSNw== + + + + + + + JBoss + JBoss by Red Hat + http://localhost:8080/sales-metadata/ + + + The + Admin + admin@mycompany.com + + + \ No newline at end of file diff --git a/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/testsaml.json b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/testsaml.json new file mode 100644 index 0000000000..71cde711a7 --- /dev/null +++ b/testsuite/jetty/jetty94/src/test/resources/keycloak-saml/testsaml.json @@ -0,0 +1,452 @@ +{ + "id": "demo", + "realm": "demo", + "enabled": true, + "sslRequired": "external", + "registrationAllowed": true, + "resetPasswordAllowed": true, + "privateKey": "MIICXAIBAAKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQABAoGAfmO8gVhyBxdqlxmIuglbz8bcjQbhXJLR2EoS8ngTXmN1bo2L90M0mUKSdc7qF10LgETBzqL8jYlQIbt+e6TH8fcEpKCjUlyq0Mf/vVbfZSNaVycY13nTzo27iPyWQHK5NLuJzn1xvxxrUeXI6A2WFpGEBLbHjwpx5WQG9A+2scECQQDvdn9NE75HPTVPxBqsEd2z10TKkl9CZxu10Qby3iQQmWLEJ9LNmy3acvKrE3gMiYNWb6xHPKiIqOR1as7L24aTAkEAtyvQOlCvr5kAjVqrEKXalj0Tzewjweuxc0pskvArTI2Oo070h65GpoIKLc9jf+UA69cRtquwP93aZKtW06U8dQJAF2Y44ks/mK5+eyDqik3koCI08qaC8HYq2wVl7G2QkJ6sbAaILtcvD92ToOvyGyeE0flvmDZxMYlvaZnaQ0lcSQJBAKZU6umJi3/xeEbkJqMfeLclD27XGEFoPeNrmdx0q10Azp4NfJAY+Z8KRyQCR2BEG+oNitBOZ+YXF9KCpH3cdmECQHEigJhYg+ykOvr1aiZUMFT72HU0jnmQe2FVekuG+LJUt2Tm7GtMjTFoGpf0JwrVuZN39fOYAlo+nTixgeW7X8Y=", + "publicKey": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQAB", + "requiredCredentials": [ "password" ], + "defaultRoles": [ "user" ], + "smtpServer": { + "from": "auto@keycloak.org", + "host": "localhost", + "port":"3025" + }, + "users" : [ + { + "username" : "bburke", + "enabled": true, + "email" : "bburke@redhat.com", + "credentials" : [ + { "type" : "password", + "value" : "password" } + ], + "attributes" : { + "phone": "617" + }, + "realmRoles": ["manager", "user"], + "applicationRoles": { + "http://localhost:8082/employee/": [ "employee" ], + "http://localhost:8082/employee2/": [ "employee" ] + } + } , + { + "username" : "unauthorized", + "enabled": true, + "email" : "unauthorized@redhat.com", + "credentials" : [ + { "type" : "password", + "value" : "password" } + ] + }, + { + "username" : "topGroupUser", + "enabled": true, + "email" : "top@redhat.com", + "credentials" : [ + { "type" : "password", + "value" : "password" } + ], + "groups": [ + "/top" + ] + }, + { + "username" : "level2GroupUser", + "enabled": true, + "email" : "level2@redhat.com", + "credentials" : [ + { "type" : "password", + "value" : "password" } + ], + "groups": [ + "/top/level2" + ] + } + ], + "applications": [ + { + "name": "http://localhost:8082/sales-post/", + "enabled": true, + "fullScopeAllowed": true, + "protocol": "saml", + "baseUrl": "http://localhost:8082/sales-post", + "redirectUris": [ + "http://localhost:8082/sales-post/*" + ], + "attributes": { + "saml.authnstatement": "true", + "saml_assertion_consumer_url_post": "http://localhost:8082/sales-post/saml", + "saml_assertion_consumer_url_redirect": "http://localhost:8082/sales-post/saml", + "saml_single_logout_service_url_post": "http://localhost:8082/sales-post/saml", + "saml_single_logout_service_url_redirect": "http://localhost:8082/sales-post/saml", + "saml_idp_initiated_sso_url_name": "sales-post" + } + }, + { + "name": "http://localhost:8082/sales-post2/", + "enabled": true, + "fullScopeAllowed": true, + "protocol": "saml", + "baseUrl": "http://localhost:8082/sales-post2", + "redirectUris": [ + "http://localhost:8082/sales-post2/*" + ], + "attributes": { + "saml.authnstatement": "true", + "saml_assertion_consumer_url_post": "http://localhost:8082/sales-post2/saml", + "saml_single_logout_service_url_post": "http://localhost:8082/sales-post2/saml", + "saml_idp_initiated_sso_url_name": "sales-post2", + "saml_idp_initiated_sso_relay_state": "redirectTo=/foo" + } + }, + { + "name": "http://localhost:8082/input-portal/", + "enabled": true, + "fullScopeAllowed": true, + "protocol": "saml", + "baseUrl": "http://localhost:8082/input-portal/", + "redirectUris": [ + "http://localhost:8082/input-portal/*" + ], + "attributes": { + "saml.authnstatement": "true", + "saml_assertion_consumer_url_post": "http://localhost:8082/input-portal/saml", + "saml_single_logout_service_url_post": "http://localhost:8082/input-portal/saml" + } + }, + { + "name": "http://localhost:8082/sales-post-sig/", + "enabled": true, + "protocol": "saml", + "fullScopeAllowed": true, + "baseUrl": "http://localhost:8082/sales-post-sig", + "redirectUris": [ + "http://localhost:8082/sales-post-sig/*" + ], + "attributes": { + "saml_assertion_consumer_url_post": "http://localhost:8082/sales-post-sig/saml", + "saml_assertion_consumer_url_redirect": "http://localhost:8082/sales-post-sig/saml", + "saml_single_logout_service_url_post": "http://localhost:8082/sales-post-sig/saml", + "saml_single_logout_service_url_redirect": "http://localhost:8082/sales-post-sig/saml", + "saml.server.signature": "true", + "saml.signature.algorithm": "RSA_SHA256", + "saml.client.signature": "true", + "saml.authnstatement": "true", + "saml.signing.certificate": "MIIB1DCCAT0CBgFJGP5dZDANBgkqhkiG9w0BAQsFADAwMS4wLAYDVQQDEyVodHRwOi8vbG9jYWxob3N0OjgwODAvc2FsZXMtcG9zdC1zaWcvMB4XDTE0MTAxNjEyNDQyM1oXDTI0MTAxNjEyNDYwM1owMDEuMCwGA1UEAxMlaHR0cDovL2xvY2FsaG9zdDo4MDgwL3NhbGVzLXBvc3Qtc2lnLzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA1RvGu8RjemSJA23nnMksoHA37MqY1DDTxOECY4rPAd9egr7GUNIXE0y1MokaR5R2crNpN8RIRwR8phQtQDjXL82c6W+NLQISxztarQJ7rdNJIYwHY0d5ri1XRpDP8zAuxubPYiMAVYcDkIcvlbBpwh/dRM5I2eElRK+eSiaMkCUCAwEAATANBgkqhkiG9w0BAQsFAAOBgQCLms6htnPaY69k1ntm9a5jgwSn/K61cdai8R8B0ccY7zvinn9AfRD7fiROQpFyY29wKn8WCLrJ86NBXfgFUGyR5nLNHVy3FghE36N2oHy53uichieMxffE6vhkKJ4P8ChfJMMOZlmCPsQPDvjoAghHt4mriFiQgRdPgIy/zDjSNw==" + } + }, + { + "name": "http://localhost:8082/sales-post-sig-transient/", + "enabled": true, + "protocol": "saml", + "fullScopeAllowed": true, + "baseUrl": "http://localhost:8082/sales-post-sig-transient", + "adminUrl": "http://localhost:8082/sales-post-sig-transient/saml", + "redirectUris": [ + "http://localhost:8082/sales-post-sig-transient/*" + ], + "attributes": { + "saml_assertion_consumer_url_post": "http://localhost:8082/sales-post-sig-transient/saml", + "saml_assertion_consumer_url_redirect": "http://localhost:8082/sales-post-sig-transient/saml", + "saml_single_logout_service_url_post": "http://localhost:8082/sales-post-sig-transient/saml", + "saml_single_logout_service_url_redirect": "http://localhost:8082/sales-post-sig-transient/saml", + "saml.server.signature": "true", + "saml.signature.algorithm": "RSA_SHA256", + "saml.client.signature": "true", + "saml.authnstatement": "true", + "saml.signing.certificate": "MIIB1DCCAT0CBgFJGP5dZDANBgkqhkiG9w0BAQsFADAwMS4wLAYDVQQDEyVodHRwOi8vbG9jYWxob3N0OjgwODAvc2FsZXMtcG9zdC1zaWcvMB4XDTE0MTAxNjEyNDQyM1oXDTI0MTAxNjEyNDYwM1owMDEuMCwGA1UEAxMlaHR0cDovL2xvY2FsaG9zdDo4MDgwL3NhbGVzLXBvc3Qtc2lnLzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA1RvGu8RjemSJA23nnMksoHA37MqY1DDTxOECY4rPAd9egr7GUNIXE0y1MokaR5R2crNpN8RIRwR8phQtQDjXL82c6W+NLQISxztarQJ7rdNJIYwHY0d5ri1XRpDP8zAuxubPYiMAVYcDkIcvlbBpwh/dRM5I2eElRK+eSiaMkCUCAwEAATANBgkqhkiG9w0BAQsFAAOBgQCLms6htnPaY69k1ntm9a5jgwSn/K61cdai8R8B0ccY7zvinn9AfRD7fiROQpFyY29wKn8WCLrJ86NBXfgFUGyR5nLNHVy3FghE36N2oHy53uichieMxffE6vhkKJ4P8ChfJMMOZlmCPsQPDvjoAghHt4mriFiQgRdPgIy/zDjSNw==" + } + }, + { + "name": "http://localhost:8082/sales-post-sig-persistent/", + "enabled": true, + "protocol": "saml", + "fullScopeAllowed": true, + "baseUrl": "http://localhost:8082/sales-post-sig-persistent", + "redirectUris": [ + "http://localhost:8082/sales-post-sig-persistent/*" + ], + "attributes": { + "saml_assertion_consumer_url_post": "http://localhost:8082/sales-post-sig-persistent/saml", + "saml_assertion_consumer_url_redirect": "http://localhost:8082/sales-post-sig-persistent/saml", + "saml_single_logout_service_url_post": "http://localhost:8082/sales-post-sig-persistent/saml", + "saml_single_logout_service_url_redirect": "http://localhost:8082/sales-post-sig-persistent/saml", + "saml.server.signature": "true", + "saml.signature.algorithm": "RSA_SHA256", + "saml.client.signature": "true", + "saml.authnstatement": "true", + "saml.signing.certificate": "MIIB1DCCAT0CBgFJGP5dZDANBgkqhkiG9w0BAQsFADAwMS4wLAYDVQQDEyVodHRwOi8vbG9jYWxob3N0OjgwODAvc2FsZXMtcG9zdC1zaWcvMB4XDTE0MTAxNjEyNDQyM1oXDTI0MTAxNjEyNDYwM1owMDEuMCwGA1UEAxMlaHR0cDovL2xvY2FsaG9zdDo4MDgwL3NhbGVzLXBvc3Qtc2lnLzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA1RvGu8RjemSJA23nnMksoHA37MqY1DDTxOECY4rPAd9egr7GUNIXE0y1MokaR5R2crNpN8RIRwR8phQtQDjXL82c6W+NLQISxztarQJ7rdNJIYwHY0d5ri1XRpDP8zAuxubPYiMAVYcDkIcvlbBpwh/dRM5I2eElRK+eSiaMkCUCAwEAATANBgkqhkiG9w0BAQsFAAOBgQCLms6htnPaY69k1ntm9a5jgwSn/K61cdai8R8B0ccY7zvinn9AfRD7fiROQpFyY29wKn8WCLrJ86NBXfgFUGyR5nLNHVy3FghE36N2oHy53uichieMxffE6vhkKJ4P8ChfJMMOZlmCPsQPDvjoAghHt4mriFiQgRdPgIy/zDjSNw==" + } + }, + { + "name": "http://localhost:8082/sales-post-sig-email/", + "enabled": true, + "protocol": "saml", + "fullScopeAllowed": true, + "baseUrl": "http://localhost:8082/sales-post-sig-email", + "adminUrl": "http://localhost:8082/sales-post-sig-email/saml", + "redirectUris": [ + "http://localhost:8082/sales-post-sig-email/*" + ], + "attributes": { + "saml_force_name_id_format": "true", + "saml_name_id_format": "email", + "saml_assertion_consumer_url_post": "http://localhost:8082/sales-post-sig-email/saml", + "saml_assertion_consumer_url_redirect": "http://localhost:8082/sales-post-sig-email/saml", + "saml_single_logout_service_url_post": "http://localhost:8082/sales-post-sig-email/saml", + "saml_single_logout_service_url_redirect": "http://localhost:8082/sales-post-sig-email/saml", + "saml.server.signature": "true", + "saml.signature.algorithm": "RSA_SHA256", + "saml.client.signature": "true", + "saml.authnstatement": "true", + "saml.signing.certificate": "MIIB1DCCAT0CBgFJGP5dZDANBgkqhkiG9w0BAQsFADAwMS4wLAYDVQQDEyVodHRwOi8vbG9jYWxob3N0OjgwODAvc2FsZXMtcG9zdC1zaWcvMB4XDTE0MTAxNjEyNDQyM1oXDTI0MTAxNjEyNDYwM1owMDEuMCwGA1UEAxMlaHR0cDovL2xvY2FsaG9zdDo4MDgwL3NhbGVzLXBvc3Qtc2lnLzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA1RvGu8RjemSJA23nnMksoHA37MqY1DDTxOECY4rPAd9egr7GUNIXE0y1MokaR5R2crNpN8RIRwR8phQtQDjXL82c6W+NLQISxztarQJ7rdNJIYwHY0d5ri1XRpDP8zAuxubPYiMAVYcDkIcvlbBpwh/dRM5I2eElRK+eSiaMkCUCAwEAATANBgkqhkiG9w0BAQsFAAOBgQCLms6htnPaY69k1ntm9a5jgwSn/K61cdai8R8B0ccY7zvinn9AfRD7fiROQpFyY29wKn8WCLrJ86NBXfgFUGyR5nLNHVy3FghE36N2oHy53uichieMxffE6vhkKJ4P8ChfJMMOZlmCPsQPDvjoAghHt4mriFiQgRdPgIy/zDjSNw==" + } + }, + { + "name": "http://localhost:8082/bad-realm-sales-post-sig/", + "enabled": true, + "protocol": "saml", + "fullScopeAllowed": true, + "baseUrl": "http://localhost:8082/bad-realm-sales-post-sig/", + "adminUrl": "http://localhost:8082/bad-realm-sales-post-sig/saml", + "redirectUris": [ + "http://localhost:8082/bad-realm-sales-post-sig/*" + ], + "attributes": { + "saml.server.signature": "true", + "saml.client.signature": "true", + "saml.authnstatement": "true", + "saml.signing.certificate": "MIIB1DCCAT0CBgFJGP5dZDANBgkqhkiG9w0BAQsFADAwMS4wLAYDVQQDEyVodHRwOi8vbG9jYWxob3N0OjgwODAvc2FsZXMtcG9zdC1zaWcvMB4XDTE0MTAxNjEyNDQyM1oXDTI0MTAxNjEyNDYwM1owMDEuMCwGA1UEAxMlaHR0cDovL2xvY2FsaG9zdDo4MDgwL3NhbGVzLXBvc3Qtc2lnLzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA1RvGu8RjemSJA23nnMksoHA37MqY1DDTxOECY4rPAd9egr7GUNIXE0y1MokaR5R2crNpN8RIRwR8phQtQDjXL82c6W+NLQISxztarQJ7rdNJIYwHY0d5ri1XRpDP8zAuxubPYiMAVYcDkIcvlbBpwh/dRM5I2eElRK+eSiaMkCUCAwEAATANBgkqhkiG9w0BAQsFAAOBgQCLms6htnPaY69k1ntm9a5jgwSn/K61cdai8R8B0ccY7zvinn9AfRD7fiROQpFyY29wKn8WCLrJ86NBXfgFUGyR5nLNHVy3FghE36N2oHy53uichieMxffE6vhkKJ4P8ChfJMMOZlmCPsQPDvjoAghHt4mriFiQgRdPgIy/zDjSNw==" + } + }, + { + "name": "http://localhost:8082/bad-client-sales-post-sig/", + "enabled": true, + "protocol": "saml", + "fullScopeAllowed": true, + "baseUrl": "http://localhost:8082/bad-client-sales-post-sig/", + "adminUrl": "http://localhost:8082/bad-client-sales-post-sig/saml", + "redirectUris": [ + "http://localhost:8082/bad-client-sales-post-sig/*" + ], + "attributes": { + "saml.server.signature": "true", + "saml.client.signature": "true", + "saml.authnstatement": "true", + "saml.signing.certificate": "MIIB1DCCAT0CBgFJGVacCDANBgkqhkiG9w0BAQsFADAwMS4wLAYDVQQDEyVodHRwOi8vbG9jYWxob3N0OjgwODAvc2FsZXMtcG9zdC1lbmMvMB4XDTE0MTAxNjE0MjA0NloXDTI0MTAxNjE0MjIyNlowMDEuMCwGA1UEAxMlaHR0cDovL2xvY2FsaG9zdDo4MDgwL3NhbGVzLXBvc3QtZW5jLzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA2+5MCT5BnVN+IYnKZcH6ev1pjXGi4feE0nOycq/VJ3aeaZMi4G9AxOxCBPupErOC7Kgm/Bw5AdJyw+Q12wSRXfJ9FhqCrLXpb7YOhbVSTJ8De5O8mW35DxAlh/cxe9FXjqPb286wKTUZ3LfGYR+X235UQeCTAPS/Ufi21EXaEikCAwEAATANBgkqhkiG9w0BAQsFAAOBgQBMrfGD9QFfx5v7ld/OAto5rjkTe3R1Qei8XRXfcs83vLaqEzjEtTuLGrJEi55kXuJgBpVmQpnwCCkkjSy0JxbqLDdVi9arfWUxEGmOr01ZHycELhDNaQcFqVMPr5kRHIHgktT8hK2IgCvd3Fy9/JCgUgCPxKfhwecyEOKxUc857g==" + } + }, + { + "name": "http://localhost:8082/sales-post-enc/", + "enabled": true, + "protocol": "saml", + "fullScopeAllowed": true, + "baseUrl": "http://localhost:8082/sales-post-enc", + "redirectUris": [ + "http://localhost:8082/sales-post-enc/*" + ], + "attributes": { + "saml_assertion_consumer_url_post": "http://localhost:8082/sales-post-enc/saml", + "saml_assertion_consumer_url_redirect": "http://localhost:8082/sales-post-enc/saml", + "saml_single_logout_service_url_post": "http://localhost:8082/sales-post-enc/saml", + "saml_single_logout_service_url_redirect": "http://localhost:8082/sales-post-enc/saml", + "saml.server.signature": "true", + "saml.signature.algorithm": "RSA_SHA512", + "saml.client.signature": "true", + "saml.encrypt": "true", + "saml.authnstatement": "true", + "saml.signing.certificate": "MIIB1DCCAT0CBgFJGVacCDANBgkqhkiG9w0BAQsFADAwMS4wLAYDVQQDEyVodHRwOi8vbG9jYWxob3N0OjgwODAvc2FsZXMtcG9zdC1lbmMvMB4XDTE0MTAxNjE0MjA0NloXDTI0MTAxNjE0MjIyNlowMDEuMCwGA1UEAxMlaHR0cDovL2xvY2FsaG9zdDo4MDgwL3NhbGVzLXBvc3QtZW5jLzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA2+5MCT5BnVN+IYnKZcH6ev1pjXGi4feE0nOycq/VJ3aeaZMi4G9AxOxCBPupErOC7Kgm/Bw5AdJyw+Q12wSRXfJ9FhqCrLXpb7YOhbVSTJ8De5O8mW35DxAlh/cxe9FXjqPb286wKTUZ3LfGYR+X235UQeCTAPS/Ufi21EXaEikCAwEAATANBgkqhkiG9w0BAQsFAAOBgQBMrfGD9QFfx5v7ld/OAto5rjkTe3R1Qei8XRXfcs83vLaqEzjEtTuLGrJEi55kXuJgBpVmQpnwCCkkjSy0JxbqLDdVi9arfWUxEGmOr01ZHycELhDNaQcFqVMPr5kRHIHgktT8hK2IgCvd3Fy9/JCgUgCPxKfhwecyEOKxUc857g==", + "saml.encryption.certificate": "MIIB1DCCAT0CBgFJGVacCDANBgkqhkiG9w0BAQsFADAwMS4wLAYDVQQDEyVodHRwOi8vbG9jYWxob3N0OjgwODAvc2FsZXMtcG9zdC1lbmMvMB4XDTE0MTAxNjE0MjA0NloXDTI0MTAxNjE0MjIyNlowMDEuMCwGA1UEAxMlaHR0cDovL2xvY2FsaG9zdDo4MDgwL3NhbGVzLXBvc3QtZW5jLzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA2+5MCT5BnVN+IYnKZcH6ev1pjXGi4feE0nOycq/VJ3aeaZMi4G9AxOxCBPupErOC7Kgm/Bw5AdJyw+Q12wSRXfJ9FhqCrLXpb7YOhbVSTJ8De5O8mW35DxAlh/cxe9FXjqPb286wKTUZ3LfGYR+X235UQeCTAPS/Ufi21EXaEikCAwEAATANBgkqhkiG9w0BAQsFAAOBgQBMrfGD9QFfx5v7ld/OAto5rjkTe3R1Qei8XRXfcs83vLaqEzjEtTuLGrJEi55kXuJgBpVmQpnwCCkkjSy0JxbqLDdVi9arfWUxEGmOr01ZHycELhDNaQcFqVMPr5kRHIHgktT8hK2IgCvd3Fy9/JCgUgCPxKfhwecyEOKxUc857g==" + } + }, + { + "name": "http://localhost:8082/employee-sig/", + "enabled": true, + "protocol": "saml", + "fullScopeAllowed": true, + "baseUrl": "http://localhost:8082/employee-sig", + "redirectUris": [ + "http://localhost:8082/employee-sig/*" + ], + "adminUrl": "http://localhost:8082/employee-sig/saml", + "attributes": { + "saml.server.signature": "true", + "saml.client.signature": "true", + "saml.signature.algorithm": "RSA_SHA256", + "saml.authnstatement": "true", + "saml.signing.certificate": "MIIB0DCCATkCBgFJH5u0EDANBgkqhkiG9w0BAQsFADAuMSwwKgYDVQQDEyNodHRwOi8vbG9jYWxob3N0OjgwODAvZW1wbG95ZWUtc2lnLzAeFw0xNDEwMTcxOTMzNThaFw0yNDEwMTcxOTM1MzhaMC4xLDAqBgNVBAMTI2h0dHA6Ly9sb2NhbGhvc3Q6ODA4MC9lbXBsb3llZS1zaWcvMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+9kVgPFpshjS2aT2g52lqTv2lqb1jgvXZVk7iFF4LAO6SdCXKXRZI4SuzIRkVNpE1a42V1kQRlaozoFklgvX5sje8tkpa9ylq+bxGXM9RRycqRu2B+oWUV7Aqq7Bs0Xud0WeHQYRcEoCjqsFKGy65qkLRDdT70FTJgpSHts+gDwIDAQABMA0GCSqGSIb3DQEBCwUAA4GBACKyPLGqMX8GsIrCfJU8eVnpaqzTXMglLVo/nTcfAnWe9UAdVe8N3a2PXpDBvuqNA/DEAhVcQgxdlOTWnB6s8/yLTRuH0bZgb3qGdySif+lU+E7zZ/SiDzavAvn+ABqemnzHcHyhYO+hNRGHvUbW5OAii9Vdjhm8BI32YF1NwhKp" + } + }, + { + "name": "http://localhost:8082/employee/", + "enabled": true, + "protocol": "saml", + "fullScopeAllowed": true, + "baseUrl": "http://localhost:8082/employee/", + "redirectUris": [ + "http://localhost:8082/employee/*" + ], + "adminUrl": "http://localhost:8082/employee/saml", + "attributes": { + "saml.authnstatement": "true" + }, + "protocolMappers": [ + { + "name": "email", + "protocol": "saml", + "protocolMapper": "saml-user-property-mapper", + "consentRequired": false, + "config": { + "user.attribute": "email", + "friendly.name": "email", + "attribute.name": "urn:oid:1.2.840.113549.1.9.1", + "attribute.nameformat": "URI Reference" + } + }, + { + "name": "phone", + "protocol": "saml", + "protocolMapper": "saml-user-attribute-mapper", + "consentRequired": false, + "config": { + "user.attribute": "phone", + "attribute.name": "phone", + "attribute.nameformat": "Basic" + } + }, + { + "name": "role-list", + "protocol": "saml", + "protocolMapper": "saml-role-list-mapper", + "consentRequired": false, + "config": { + "attribute.name": "Role", + "attribute.nameformat": "Basic", + "single": "false" + } + } + ] + }, + { + "name": "http://localhost:8082/employee2/", + "enabled": true, + "protocol": "saml", + "fullScopeAllowed": true, + "baseUrl": "http://localhost:8082/employee2/", + "redirectUris": [ + "http://localhost:8082/employee2/*" + ], + "adminUrl": "http://localhost:8082/employee2/saml", + "attributes": { + "saml.authnstatement": "true" + }, + "protocolMappers": [ + { + "name": "email", + "protocol": "saml", + "protocolMapper": "saml-user-property-mapper", + "consentRequired": false, + "config": { + "user.attribute": "email", + "friendly.name": "email", + "attribute.name": "urn:oid:1.2.840.113549.1.9.1", + "attribute.nameformat": "URI Reference" + } + }, + { + "name": "phone", + "protocol": "saml", + "protocolMapper": "saml-user-attribute-mapper", + "consentRequired": false, + "config": { + "user.attribute": "phone", + "attribute.name": "phone", + "attribute.nameformat": "Basic" + } + }, + { + "name": "role-list", + "protocol": "saml", + "protocolMapper": "saml-role-list-mapper", + "consentRequired": false, + "config": { + "attribute.name": "Role", + "attribute.nameformat": "Basic", + "single": "false" + } + } + ] + }, + { + "name": "http://localhost:8082/employee-sig-front/", + "enabled": true, + "protocol": "saml", + "fullScopeAllowed": true, + "frontchannelLogout": true, + "baseUrl": "http://localhost:8082/employee-sig-front/", + "redirectUris": [ + "http://localhost:8082/employee-sig-front/*" + ], + "attributes": { + "saml_assertion_consumer_url_post": "http://localhost:8082/employee-sig-front/saml", + "saml_assertion_consumer_url_redirect": "http://localhost:8082/employee-sig-front/saml", + "saml_single_logout_service_url_post": "http://localhost:8082/employee-sig-front/saml", + "saml_single_logout_service_url_redirect": "http://localhost:8082/employee-sig-front/saml", + "saml.server.signature": "true", + "saml.client.signature": "true", + "saml.signature.algorithm": "RSA_SHA1", + "saml.authnstatement": "true", + "saml.signing.certificate": "MIIB0DCCATkCBgFJH5u0EDANBgkqhkiG9w0BAQsFADAuMSwwKgYDVQQDEyNodHRwOi8vbG9jYWxob3N0OjgwODAvZW1wbG95ZWUtc2lnLzAeFw0xNDEwMTcxOTMzNThaFw0yNDEwMTcxOTM1MzhaMC4xLDAqBgNVBAMTI2h0dHA6Ly9sb2NhbGhvc3Q6ODA4MC9lbXBsb3llZS1zaWcvMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+9kVgPFpshjS2aT2g52lqTv2lqb1jgvXZVk7iFF4LAO6SdCXKXRZI4SuzIRkVNpE1a42V1kQRlaozoFklgvX5sje8tkpa9ylq+bxGXM9RRycqRu2B+oWUV7Aqq7Bs0Xud0WeHQYRcEoCjqsFKGy65qkLRDdT70FTJgpSHts+gDwIDAQABMA0GCSqGSIb3DQEBCwUAA4GBACKyPLGqMX8GsIrCfJU8eVnpaqzTXMglLVo/nTcfAnWe9UAdVe8N3a2PXpDBvuqNA/DEAhVcQgxdlOTWnB6s8/yLTRuH0bZgb3qGdySif+lU+E7zZ/SiDzavAvn+ABqemnzHcHyhYO+hNRGHvUbW5OAii9Vdjhm8BI32YF1NwhKp" + } + } + ], + "groups" : [ + { + "name": "top", + "attributes": { + "topAttribute": ["true"] + + }, + "realmRoles": ["manager"], + "subGroups": [ + { + "name": "level2", + "realmRoles": ["user"], + "attributes": { + "level2Attribute": ["true"] + + } + } + ] + } + ], + "roles" : { + "realm" : [ + { + "name": "manager", + "description": "Have Manager privileges" + }, + { + "name": "user", + "description": "Have User privileges" + } + ], + "application" : { + "http://localhost:8082/employee/" : [ + { + "name": "employee", + "description": "Have Employee privileges" + } + ], + "http://localhost:8082/employee2/" : [ + { + "name": "employee", + "description": "Have Employee privileges" + } + ] + } + } +} diff --git a/testsuite/jetty/pom.xml b/testsuite/jetty/pom.xml index 783dc263a4..fdfd92628f 100755 --- a/testsuite/jetty/pom.xml +++ b/testsuite/jetty/pom.xml @@ -35,5 +35,6 @@ jetty91 jetty92 jetty93 + jetty94