From 51b84291f9219ac4f578dfb4dc8be8cbe76c7a7b Mon Sep 17 00:00:00 2001 From: Jonathan Coustick Date: Tue, 6 Apr 2021 14:22:27 +0100 Subject: [PATCH 1/4] FISH-84 Fix for listing modules in an EAR in admin console --- .../src/main/resources/cdiDevMode/cdiDevModeApplication.jsf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appserver/admingui/payara-console-extras/src/main/resources/cdiDevMode/cdiDevModeApplication.jsf b/appserver/admingui/payara-console-extras/src/main/resources/cdiDevMode/cdiDevModeApplication.jsf index ac7f7fc873f..3cb0aa9ab6c 100644 --- a/appserver/admingui/payara-console-extras/src/main/resources/cdiDevMode/cdiDevModeApplication.jsf +++ b/appserver/admingui/payara-console-extras/src/main/resources/cdiDevMode/cdiDevModeApplication.jsf @@ -1,7 +1,7 @@ + onClick="var win=window.open('#{request.contextPath}/payaraExtras/cdiDevMode/cdiDevMode.jsf?appName=#{pageSession.encodedAppName}&contextRoot=#{pageSession.td.value.contextRoot}','ViewerWindow','width='+.75*screen.width+',height='+.75*screen.height+',top='+.1*screen.height+',left='+.1*screen.width+',toolbar=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,directories=yes,location=yes');win.focus(); return false;" > Date: Thu, 22 Apr 2021 09:08:28 +0200 Subject: [PATCH 2/4] FISH-84 - get Bean Manager from JNDI instead of from CDI Signed-off-by: Ondro Mihalyi --- .../payara/security/openid/OpenIdUtil.java | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/appserver/payara-appserver-modules/security-openid/src/main/java/fish/payara/security/openid/OpenIdUtil.java b/appserver/payara-appserver-modules/security-openid/src/main/java/fish/payara/security/openid/OpenIdUtil.java index aafaf8e18af..7af03b45ce5 100644 --- a/appserver/payara-appserver-modules/security-openid/src/main/java/fish/payara/security/openid/OpenIdUtil.java +++ b/appserver/payara-appserver-modules/security-openid/src/main/java/fish/payara/security/openid/OpenIdUtil.java @@ -40,10 +40,15 @@ package fish.payara.security.openid; import java.util.Optional; +import java.util.Random; import java.util.function.Predicate; +import java.util.logging.Level; +import java.util.logging.Logger; import javax.el.ELProcessor; import javax.enterprise.inject.spi.BeanManager; import javax.enterprise.inject.spi.CDI; +import javax.naming.InitialContext; +import javax.naming.NamingException; import org.eclipse.microprofile.config.Config; import org.glassfish.config.support.TranslatedConfigView; @@ -71,12 +76,25 @@ public static T getConfiguredValue(Class type, T value, Config provider, } if (type == String.class && isELExpression((String) value)) { ELProcessor elProcessor = new ELProcessor(); - BeanManager beanManager = CDI.current().getBeanManager(); + BeanManager beanManager = getBeanManagerForCurrentModule(); elProcessor.getELManager().addELResolver(beanManager.getELResolver()); result = (T) elProcessor.getValue(toRawExpression((String) result), type); } return result; } + + private static BeanManager getBeanManagerForCurrentModule() { + /* + For some reason, CDI.current().getBeanManager() doesn't always return + the correct bean manager in EAR, therefore we're using JNDI lookup until this is fixed. + See https://lists.jboss.org/pipermail/cdi-dev/2016-April/008185.html + */ + try { + return (BeanManager) new InitialContext().lookup("java:comp/BeanManager"); + } catch (NamingException ex) { + throw new RuntimeException(ex); + } + } public static boolean isELExpression(String expression) { return !expression.isEmpty() && isDeferredExpression(expression); From 1078becdf630807bf006b14ecfc08219f51c6b4a Mon Sep 17 00:00:00 2001 From: Ondrej Mihalyi Date: Thu, 22 Apr 2021 11:37:08 +0200 Subject: [PATCH 3/4] FISH-84 Tests for configuring OpenID using EL in EAR Signed-off-by: Ondro Mihalyi --- .../security/oidc/client/ear/SomeEJB.java | 8 ++ .../client/eltests/OpenidConfigBeanEL.java | 12 +++ .../oidc/client/eltests/SecuredPageEL.java | 75 ++++++++++++++++ .../resources/ear/META-INF/application.xml | 13 +++ .../security/oidc/test/OpenIdELInEarTest.java | 85 +++++++++++++++++++ .../security/oidc/test/OpenIdELTest.java | 84 ++++++++++++++++++ .../security/oidc/test/OpenIdTestUtil.java | 28 +++++- 7 files changed, 301 insertions(+), 4 deletions(-) create mode 100644 appserver/tests/payara-samples/samples/openid/src/main/java/fish/payara/security/oidc/client/ear/SomeEJB.java create mode 100644 appserver/tests/payara-samples/samples/openid/src/main/java/fish/payara/security/oidc/client/eltests/OpenidConfigBeanEL.java create mode 100644 appserver/tests/payara-samples/samples/openid/src/main/java/fish/payara/security/oidc/client/eltests/SecuredPageEL.java create mode 100644 appserver/tests/payara-samples/samples/openid/src/main/resources/ear/META-INF/application.xml create mode 100644 appserver/tests/payara-samples/samples/openid/src/test/java/fish/payara/security/oidc/test/OpenIdELInEarTest.java create mode 100644 appserver/tests/payara-samples/samples/openid/src/test/java/fish/payara/security/oidc/test/OpenIdELTest.java diff --git a/appserver/tests/payara-samples/samples/openid/src/main/java/fish/payara/security/oidc/client/ear/SomeEJB.java b/appserver/tests/payara-samples/samples/openid/src/main/java/fish/payara/security/oidc/client/ear/SomeEJB.java new file mode 100644 index 00000000000..660eaa92362 --- /dev/null +++ b/appserver/tests/payara-samples/samples/openid/src/main/java/fish/payara/security/oidc/client/ear/SomeEJB.java @@ -0,0 +1,8 @@ +package fish.payara.security.oidc.client.ear; + +import javax.ejb.Stateless; + +@Stateless +public class SomeEJB { + +} diff --git a/appserver/tests/payara-samples/samples/openid/src/main/java/fish/payara/security/oidc/client/eltests/OpenidConfigBeanEL.java b/appserver/tests/payara-samples/samples/openid/src/main/java/fish/payara/security/oidc/client/eltests/OpenidConfigBeanEL.java new file mode 100644 index 00000000000..1a4a5dba44d --- /dev/null +++ b/appserver/tests/payara-samples/samples/openid/src/main/java/fish/payara/security/oidc/client/eltests/OpenidConfigBeanEL.java @@ -0,0 +1,12 @@ +package fish.payara.security.oidc.client.eltests; + +import javax.inject.Named; + +@Named +public class OpenidConfigBeanEL { + + public String getTokenEndpointURL() { + return "http://localhost:8080/openid-server/webresources/oidc-provider"; + } + +} diff --git a/appserver/tests/payara-samples/samples/openid/src/main/java/fish/payara/security/oidc/client/eltests/SecuredPageEL.java b/appserver/tests/payara-samples/samples/openid/src/main/java/fish/payara/security/oidc/client/eltests/SecuredPageEL.java new file mode 100644 index 00000000000..baf3aa5c8ee --- /dev/null +++ b/appserver/tests/payara-samples/samples/openid/src/main/java/fish/payara/security/oidc/client/eltests/SecuredPageEL.java @@ -0,0 +1,75 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) [2018] Payara Foundation and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * https://github.com/payara/Payara/blob/master/LICENSE.txt + * See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at glassfish/legal/LICENSE.txt. + * + * GPL Classpath Exception: + * The Payara Foundation designates this particular file as subject to the "Classpath" + * exception as provided by the Payara Foundation in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. + */ +package fish.payara.security.oidc.client.eltests; + +import fish.payara.security.annotations.OpenIdAuthenticationDefinition; +import static fish.payara.security.oidc.server.OidcProvider.CLIENT_ID_VALUE; +import static fish.payara.security.oidc.server.OidcProvider.CLIENT_SECRET_VALUE; +import java.io.IOException; +import javax.annotation.security.DeclareRoles; +import javax.inject.Inject; +import javax.servlet.ServletException; +import javax.servlet.annotation.HttpConstraint; +import javax.servlet.annotation.ServletSecurity; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * @author Gaurav Gupta + */ +@WebServlet("/Secured") +@OpenIdAuthenticationDefinition( + providerURI = "#{openidConfigBeanEL.tokenEndpointURL}", + clientId = CLIENT_ID_VALUE, + clientSecret = CLIENT_SECRET_VALUE, + redirectURI = "${baseURL}/Callback" +) +@DeclareRoles("all") +@ServletSecurity(@HttpConstraint(rolesAllowed = "all")) +public class SecuredPageEL extends HttpServlet { + + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + response.getWriter().println("This is a secured web page"); + } +} diff --git a/appserver/tests/payara-samples/samples/openid/src/main/resources/ear/META-INF/application.xml b/appserver/tests/payara-samples/samples/openid/src/main/resources/ear/META-INF/application.xml new file mode 100644 index 00000000000..786874aabf8 --- /dev/null +++ b/appserver/tests/payara-samples/samples/openid/src/main/resources/ear/META-INF/application.xml @@ -0,0 +1,13 @@ + + + ElBugExample-ear + + + openid-client.war + /openid-client + + + + openid-client-dummy-ejb.jar + + \ No newline at end of file diff --git a/appserver/tests/payara-samples/samples/openid/src/test/java/fish/payara/security/oidc/test/OpenIdELInEarTest.java b/appserver/tests/payara-samples/samples/openid/src/test/java/fish/payara/security/oidc/test/OpenIdELInEarTest.java new file mode 100644 index 00000000000..4d7ad023f06 --- /dev/null +++ b/appserver/tests/payara-samples/samples/openid/src/test/java/fish/payara/security/oidc/test/OpenIdELInEarTest.java @@ -0,0 +1,85 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) [2018-2020] Payara Foundation and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * https://github.com/payara/Payara/blob/master/LICENSE.txt + * See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at glassfish/legal/LICENSE.txt. + * + * GPL Classpath Exception: + * The Payara Foundation designates this particular file as subject to the "Classpath" + * exception as provided by the Payara Foundation in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. + */ +package fish.payara.security.oidc.test; + +import com.gargoylesoftware.htmlunit.WebClient; +import fish.payara.samples.NotMicroCompatible; +import fish.payara.samples.PayaraArquillianTestRunner; +import java.io.IOException; +import java.net.URL; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.container.test.api.OperateOnDeployment; +import org.jboss.arquillian.container.test.api.RunAsClient; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.Test; +import org.junit.runner.RunWith; + +/** + * + * @author Gaurav Gupta + */ +@NotMicroCompatible +@RunWith(PayaraArquillianTestRunner.class) +public class OpenIdELInEarTest { + + @OperateOnDeployment("openid-client") + @ArquillianResource + private URL base; + + @Deployment(name = "openid-server") + public static WebArchive createServerDeployment() { + return OpenIdTestUtil.createServerDeployment(); + } + + @Deployment(name = "openid-client") + public static EnterpriseArchive createClientDeployment() { + return OpenIdTestUtil.createClientDeploymentForELInEarTest(); + } + + @Test + @RunAsClient + public void testOpenIdConnect() throws IOException { + WebClient webClient = new WebClient(); + OpenIdTestUtil.testOpenIdConnect(webClient, base); + } + +} diff --git a/appserver/tests/payara-samples/samples/openid/src/test/java/fish/payara/security/oidc/test/OpenIdELTest.java b/appserver/tests/payara-samples/samples/openid/src/test/java/fish/payara/security/oidc/test/OpenIdELTest.java new file mode 100644 index 00000000000..895a59b6853 --- /dev/null +++ b/appserver/tests/payara-samples/samples/openid/src/test/java/fish/payara/security/oidc/test/OpenIdELTest.java @@ -0,0 +1,84 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) [2018-2020] Payara Foundation and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * https://github.com/payara/Payara/blob/master/LICENSE.txt + * See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at glassfish/legal/LICENSE.txt. + * + * GPL Classpath Exception: + * The Payara Foundation designates this particular file as subject to the "Classpath" + * exception as provided by the Payara Foundation in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. + */ +package fish.payara.security.oidc.test; + +import com.gargoylesoftware.htmlunit.WebClient; +import fish.payara.samples.NotMicroCompatible; +import fish.payara.samples.PayaraArquillianTestRunner; +import java.io.IOException; +import java.net.URL; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.container.test.api.OperateOnDeployment; +import org.jboss.arquillian.container.test.api.RunAsClient; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.Test; +import org.junit.runner.RunWith; + +/** + * + * @author Gaurav Gupta + */ +@NotMicroCompatible +@RunWith(PayaraArquillianTestRunner.class) +public class OpenIdELTest { + + @OperateOnDeployment("openid-client") + @ArquillianResource + private URL base; + + @Deployment(name = "openid-server") + public static WebArchive createServerDeployment() { + return OpenIdTestUtil.createServerDeployment(); + } + + @Deployment(name = "openid-client") + public static WebArchive createClientDeployment() { + return OpenIdTestUtil.createClientDeploymentForELTest(); + } + + @Test + @RunAsClient + public void testOpenIdConnect() throws IOException { + WebClient webClient = new WebClient(); + OpenIdTestUtil.testOpenIdConnect(webClient, base); + } + +} diff --git a/appserver/tests/payara-samples/samples/openid/src/test/java/fish/payara/security/oidc/test/OpenIdTestUtil.java b/appserver/tests/payara-samples/samples/openid/src/test/java/fish/payara/security/oidc/test/OpenIdTestUtil.java index 1b41a65e634..9bb50cc6957 100644 --- a/appserver/tests/payara-samples/samples/openid/src/test/java/fish/payara/security/oidc/test/OpenIdTestUtil.java +++ b/appserver/tests/payara-samples/samples/openid/src/test/java/fish/payara/security/oidc/test/OpenIdTestUtil.java @@ -44,6 +44,8 @@ import fish.payara.security.oidc.client.Callback; import fish.payara.security.oidc.client.SecuredPage; import fish.payara.security.oidc.client.UnsecuredPage; +import fish.payara.security.oidc.client.ear.SomeEJB; +import fish.payara.security.oidc.client.eltests.SecuredPageEL; import fish.payara.security.oidc.server.ApplicationConfig; import fish.payara.security.oidc.server.OidcProvider; import java.io.IOException; @@ -51,7 +53,7 @@ import javax.ws.rs.core.Response.Status; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.asset.EmptyAsset; -import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.shrinkwrap.api.spec.*; import static org.junit.Assert.assertEquals; /** @@ -68,21 +70,39 @@ public static WebArchive createServerDeployment() { .addClass(ApplicationConfig.class) .addAsResource("openid-configuration.json") .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); - System.out.println(war.toString(true)); return war; } public static WebArchive createClientDeployment() { WebArchive war = ShrinkWrap - .create(WebArchive.class) + .create(WebArchive.class, "openid-client.war") .addClass(Callback.class) .addClass(SecuredPage.class) .addClass(UnsecuredPage.class) .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); - System.out.println(war.toString(true)); return war; } + public static WebArchive createClientDeploymentForELTest() { + WebArchive war = ShrinkWrap + .create(WebArchive.class, "openid-client.war") + .addPackage(SecuredPageEL.class.getPackage()) + .addClass(Callback.class) + .addClass(UnsecuredPage.class) + .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + return war; + } + + public static EnterpriseArchive createClientDeploymentForELInEarTest() { + WebArchive war = createClientDeploymentForELTest(); + JavaArchive ejbJar = ShrinkWrap.create(JavaArchive.class, "openid-client-dummy-ejb.jar") + .addClass(SomeEJB.class); + EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "openid-client.ear") + .addAsModules(war, ejbJar) + .addAsResource("ear/META-INF/application.xml", "application.xml"); + return ear; + } + public static void testOpenIdConnect(WebClient webClient, URL base) throws IOException { TextPage unsecuredPage = (TextPage) webClient.getPage(base + "Unsecured"); assertEquals(Status.OK.getStatusCode(), unsecuredPage.getWebResponse().getStatusCode()); From 1f4ff2020af06b74abb3c06e481e2442f19f63d1 Mon Sep 17 00:00:00 2001 From: Ondrej Mihalyi Date: Thu, 22 Apr 2021 12:12:09 +0200 Subject: [PATCH 4/4] FISH-84 Cleanup - sanitize imports, updated copyright headers Signed-off-by: Ondro Mihalyi --- .../payara/security/openid/OpenIdUtil.java | 6 +-- .../client/eltests/OpenidConfigBeanEL.java | 39 +++++++++++++++++++ .../oidc/client/eltests/SecuredPageEL.java | 3 +- .../security/oidc/test/OpenIdELInEarTest.java | 2 +- .../security/oidc/test/OpenIdELTest.java | 2 +- 5 files changed, 43 insertions(+), 9 deletions(-) diff --git a/appserver/payara-appserver-modules/security-openid/src/main/java/fish/payara/security/openid/OpenIdUtil.java b/appserver/payara-appserver-modules/security-openid/src/main/java/fish/payara/security/openid/OpenIdUtil.java index 7af03b45ce5..0ff8782e279 100644 --- a/appserver/payara-appserver-modules/security-openid/src/main/java/fish/payara/security/openid/OpenIdUtil.java +++ b/appserver/payara-appserver-modules/security-openid/src/main/java/fish/payara/security/openid/OpenIdUtil.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) [2018] Payara Foundation and/or its affiliates. All rights reserved. + * Copyright (c) [2018-2021] Payara Foundation and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development @@ -40,13 +40,9 @@ package fish.payara.security.openid; import java.util.Optional; -import java.util.Random; import java.util.function.Predicate; -import java.util.logging.Level; -import java.util.logging.Logger; import javax.el.ELProcessor; import javax.enterprise.inject.spi.BeanManager; -import javax.enterprise.inject.spi.CDI; import javax.naming.InitialContext; import javax.naming.NamingException; import org.eclipse.microprofile.config.Config; diff --git a/appserver/tests/payara-samples/samples/openid/src/main/java/fish/payara/security/oidc/client/eltests/OpenidConfigBeanEL.java b/appserver/tests/payara-samples/samples/openid/src/main/java/fish/payara/security/oidc/client/eltests/OpenidConfigBeanEL.java index 1a4a5dba44d..3f5368a2502 100644 --- a/appserver/tests/payara-samples/samples/openid/src/main/java/fish/payara/security/oidc/client/eltests/OpenidConfigBeanEL.java +++ b/appserver/tests/payara-samples/samples/openid/src/main/java/fish/payara/security/oidc/client/eltests/OpenidConfigBeanEL.java @@ -1,3 +1,42 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) [2021] Payara Foundation and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * https://github.com/payara/Payara/blob/master/LICENSE.txt + * See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at glassfish/legal/LICENSE.txt. + * + * GPL Classpath Exception: + * The Payara Foundation designates this particular file as subject to the "Classpath" + * exception as provided by the Payara Foundation in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. + */ package fish.payara.security.oidc.client.eltests; import javax.inject.Named; diff --git a/appserver/tests/payara-samples/samples/openid/src/main/java/fish/payara/security/oidc/client/eltests/SecuredPageEL.java b/appserver/tests/payara-samples/samples/openid/src/main/java/fish/payara/security/oidc/client/eltests/SecuredPageEL.java index baf3aa5c8ee..bb0985b2b29 100644 --- a/appserver/tests/payara-samples/samples/openid/src/main/java/fish/payara/security/oidc/client/eltests/SecuredPageEL.java +++ b/appserver/tests/payara-samples/samples/openid/src/main/java/fish/payara/security/oidc/client/eltests/SecuredPageEL.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) [2018] Payara Foundation and/or its affiliates. All rights reserved. + * Copyright (c) [2021] Payara Foundation and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development @@ -44,7 +44,6 @@ import static fish.payara.security.oidc.server.OidcProvider.CLIENT_SECRET_VALUE; import java.io.IOException; import javax.annotation.security.DeclareRoles; -import javax.inject.Inject; import javax.servlet.ServletException; import javax.servlet.annotation.HttpConstraint; import javax.servlet.annotation.ServletSecurity; diff --git a/appserver/tests/payara-samples/samples/openid/src/test/java/fish/payara/security/oidc/test/OpenIdELInEarTest.java b/appserver/tests/payara-samples/samples/openid/src/test/java/fish/payara/security/oidc/test/OpenIdELInEarTest.java index 4d7ad023f06..7c093f8886b 100644 --- a/appserver/tests/payara-samples/samples/openid/src/test/java/fish/payara/security/oidc/test/OpenIdELInEarTest.java +++ b/appserver/tests/payara-samples/samples/openid/src/test/java/fish/payara/security/oidc/test/OpenIdELInEarTest.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) [2018-2020] Payara Foundation and/or its affiliates. All rights reserved. + * Copyright (c) [2018-2021] Payara Foundation and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development diff --git a/appserver/tests/payara-samples/samples/openid/src/test/java/fish/payara/security/oidc/test/OpenIdELTest.java b/appserver/tests/payara-samples/samples/openid/src/test/java/fish/payara/security/oidc/test/OpenIdELTest.java index 895a59b6853..4523874a715 100644 --- a/appserver/tests/payara-samples/samples/openid/src/test/java/fish/payara/security/oidc/test/OpenIdELTest.java +++ b/appserver/tests/payara-samples/samples/openid/src/test/java/fish/payara/security/oidc/test/OpenIdELTest.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) [2018-2020] Payara Foundation and/or its affiliates. All rights reserved. + * Copyright (c) [2018-2021] Payara Foundation and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development