├── .github
└── ISSUE_TEMPLATE
│ └── tck_challenge.md
├── .gitignore
├── CONTRIBUTING.md
├── LICENSE.md
├── NOTICE.md
├── README.md
├── api
├── .gitignore
├── pom.xml
└── src
│ └── main
│ ├── java
│ ├── jakarta
│ │ └── security
│ │ │ └── auth
│ │ │ └── message
│ │ │ ├── AuthException.java
│ │ │ ├── AuthStatus.java
│ │ │ ├── ClientAuth.java
│ │ │ ├── MessageInfo.java
│ │ │ ├── MessagePolicy.java
│ │ │ ├── ServerAuth.java
│ │ │ ├── callback
│ │ │ ├── CallerPrincipalCallback.java
│ │ │ ├── CertStoreCallback.java
│ │ │ ├── GroupPrincipalCallback.java
│ │ │ ├── PasswordValidationCallback.java
│ │ │ ├── PrivateKeyCallback.java
│ │ │ ├── SecretKeyCallback.java
│ │ │ ├── TrustStoreCallback.java
│ │ │ └── package.html
│ │ │ ├── config
│ │ │ ├── AuthConfig.java
│ │ │ ├── AuthConfigFactory.java
│ │ │ ├── AuthConfigProvider.java
│ │ │ ├── ClientAuthConfig.java
│ │ │ ├── ClientAuthContext.java
│ │ │ ├── RegistrationListener.java
│ │ │ ├── ServerAuthConfig.java
│ │ │ ├── ServerAuthContext.java
│ │ │ └── package.html
│ │ │ ├── module
│ │ │ ├── ClientAuthModule.java
│ │ │ ├── ServerAuthModule.java
│ │ │ └── package.html
│ │ │ └── package.html
│ └── module-info.java
│ ├── javadoc
│ └── doc-files
│ │ └── speclicense.html
│ └── resources
│ └── exclude-common.xml
├── pom.xml
├── spec
├── README.md
├── assembly.xml
├── pom.xml
└── src
│ ├── main
│ ├── asciidoc
│ │ ├── authentication-spec.adoc
│ │ ├── future-profiles.adoc
│ │ ├── images
│ │ │ ├── authn-1.png
│ │ │ ├── authn-1.svg
│ │ │ ├── authn-2.png
│ │ │ ├── authn-3.png
│ │ │ ├── authn-4.png
│ │ │ └── jakarta_ee_logo_schooner_color_stacked_default.png
│ │ ├── issues.adoc
│ │ ├── license-efsl.adoc
│ │ ├── loginmodule-bridge-profile.adoc
│ │ ├── message-authentication.adoc
│ │ ├── overview.adoc
│ │ ├── preface.adoc
│ │ ├── related-documents.adoc
│ │ ├── revision-history.adoc
│ │ ├── servlet-container-profile.adoc
│ │ └── soap-profile.adoc
│ └── theme
│ │ └── jakartaee-theme.yml
│ └── theme
│ └── jakartaee-theme.yml
├── tck-dist
├── README.md
├── pom.xml
├── src
│ └── main
│ │ ├── EFTL.txt
│ │ └── assembly
│ │ └── assembly.xml
└── userguide
│ ├── README.md
│ ├── pom.xml
│ └── src
│ ├── main
│ └── jbake
│ │ ├── assets
│ │ ├── README.md
│ │ ├── _config.yml
│ │ ├── css
│ │ │ └── style.css
│ │ └── img
│ │ │ └── eclipse_foundation_logo_tiny.png
│ │ ├── content
│ │ ├── README
│ │ ├── attributes.conf
│ │ ├── config.adoc
│ │ ├── config.inc
│ │ ├── debug-tips.inc
│ │ ├── debug.adoc
│ │ ├── defns.inc
│ │ ├── faq.adoc
│ │ ├── install-server-vi.inc
│ │ ├── install-server.inc
│ │ ├── install.adoc
│ │ ├── intro.adoc
│ │ ├── intro.inc
│ │ ├── packages.inc
│ │ ├── platforms.inc
│ │ ├── preface.adoc
│ │ ├── rebuild.adoc
│ │ ├── rebuild.inc
│ │ ├── req-software.inc
│ │ ├── rules.adoc
│ │ ├── rules.inc
│ │ ├── tck-packages.inc
│ │ ├── title.adoc
│ │ ├── title.inc
│ │ ├── toc.adoc
│ │ ├── using-examples.inc
│ │ ├── using.adoc
│ │ └── using.inc
│ │ ├── jbake.properties
│ │ └── templates
│ │ ├── footer.ftl
│ │ ├── header.ftl
│ │ ├── menu.ftl
│ │ └── page.ftl
│ └── theme
│ └── jakartaee-theme.yml
└── tck
├── async-authentication
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── ee
│ │ │ └── jakarta
│ │ │ └── tck
│ │ │ └── authentication
│ │ │ └── test
│ │ │ └── ejbasyncauthentication
│ │ │ ├── bean
│ │ │ └── AsyncBean.java
│ │ │ ├── sam
│ │ │ ├── SamAutoRegistrationListener.java
│ │ │ └── TestServerAuthModule.java
│ │ │ └── servlet
│ │ │ └── AsyncServlet.java
│ └── webapp
│ │ └── WEB-INF
│ │ └── web.xml
│ └── test
│ └── java
│ └── ee
│ └── jakarta
│ └── tck
│ └── authentication
│ └── test
│ └── ejbasyncauthentication
│ └── AsyncAuthenticationPublicTest.java
├── authentication-signaturegen
└── pom.xml
├── authentication-signaturetest
├── pom.xml
└── src
│ └── test
│ ├── java
│ └── ee
│ │ └── jakarta
│ │ └── tck
│ │ └── authentication
│ │ └── signaturetest
│ │ ├── AuthenticationSigTestIT.java
│ │ ├── PackageList.java
│ │ ├── README
│ │ ├── SigTest.java
│ │ ├── SigTestData.java
│ │ ├── SigTestDriver.java
│ │ ├── SigTestEE.java
│ │ ├── SigTestResult.java
│ │ ├── SignatureTestDriver.java
│ │ ├── SignatureTestDriverFactory.java
│ │ └── TestUtil.java
│ └── resources
│ └── ee
│ └── jakarta
│ └── tck
│ └── authentication
│ └── signaturetest
│ ├── jakarta.security.auth.message.sig_3.1.0-SNAPSHOT
│ ├── sig-test-pkg-list.txt
│ └── sig-test.map
├── basic-authentication
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── ee
│ │ │ └── jakarta
│ │ │ └── tck
│ │ │ └── authentication
│ │ │ └── test
│ │ │ └── basic
│ │ │ ├── sam
│ │ │ ├── SamAutoRegistrationListener.java
│ │ │ └── TestServerAuthModule.java
│ │ │ └── servlet
│ │ │ ├── ProtectedServlet.java
│ │ │ └── PublicServlet.java
│ └── webapp
│ │ └── WEB-INF
│ │ └── web.xml
│ └── test
│ └── java
│ └── ee
│ └── jakarta
│ └── tck
│ └── authentication
│ └── test
│ └── basic
│ ├── BasicAuthenticationProtectedTest.java
│ ├── BasicAuthenticationPublicTest.java
│ └── BasicAuthenticationStatelessTest.java
├── common
├── pom.xml
└── src
│ └── main
│ └── java
│ └── ee
│ └── jakarta
│ └── tck
│ └── authentication
│ └── test
│ └── common
│ ├── ArquillianBase.java
│ └── logging
│ ├── client
│ ├── LogFileProcessor.java
│ ├── LogRecordEntry.java
│ └── TestUtil.java
│ └── server
│ ├── TSLogRecord.java
│ ├── TSLogger.java
│ └── TSXMLFormatter.java
├── custom-principal
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── ee
│ │ │ └── jakarta
│ │ │ └── tck
│ │ │ └── authentication
│ │ │ └── test
│ │ │ └── customprincipal
│ │ │ ├── sam
│ │ │ ├── MyPrincipal.java
│ │ │ ├── SamAutoRegistrationListener.java
│ │ │ └── TestServerAuthModule.java
│ │ │ └── servlet
│ │ │ ├── ProtectedServlet.java
│ │ │ └── PublicServlet.java
│ └── webapp
│ │ └── WEB-INF
│ │ └── web.xml
│ └── test
│ └── java
│ └── ee
│ └── jakarta
│ └── tck
│ └── authentication
│ └── test
│ └── customprincipal
│ ├── CustomPrincipalProtectedTest.java
│ ├── CustomPrincipalPublicTest.java
│ └── CustomPrincipalStatelessTest.java
├── dispatching-jsf-cdi
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── ee
│ │ │ └── jakarta
│ │ │ └── tck
│ │ │ └── authentication
│ │ │ └── test
│ │ │ └── dispatching
│ │ │ ├── bean
│ │ │ └── MyBean.java
│ │ │ ├── sam
│ │ │ ├── SamAutoRegistrationListener.java
│ │ │ └── TestServerAuthModule.java
│ │ │ └── servlet
│ │ │ ├── ForwardedServlet.java
│ │ │ ├── IncludedServlet.java
│ │ │ ├── ProtectedServlet.java
│ │ │ └── PublicServlet.java
│ └── webapp
│ │ ├── WEB-INF
│ │ ├── beans.xml
│ │ ├── faces-config.xml
│ │ └── web.xml
│ │ ├── forward-cdi.xhtml
│ │ ├── forward.xhtml
│ │ ├── include-cdi.xhtml
│ │ └── include.xhtml
│ └── test
│ └── java
│ └── ee
│ └── jakarta
│ └── tck
│ └── authentication
│ └── test
│ └── dispatching
│ ├── CDIForwardTest.java
│ ├── CDIIncludeTest.java
│ ├── JSFCDIForwardTest.java
│ ├── JSFCDIIncludeTest.java
│ └── JSFForwardTest.java
├── dispatching
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── ee
│ │ │ └── jakarta
│ │ │ └── tck
│ │ │ └── authentication
│ │ │ └── test
│ │ │ └── dispatching
│ │ │ ├── sam
│ │ │ ├── SamAutoRegistrationListener.java
│ │ │ └── TestServerAuthModule.java
│ │ │ └── servlet
│ │ │ ├── ForwardedServlet.java
│ │ │ ├── IncludedServlet.java
│ │ │ ├── ProtectedServlet.java
│ │ │ └── PublicServlet.java
│ └── webapp
│ │ └── WEB-INF
│ │ └── web.xml
│ └── test
│ └── java
│ └── ee
│ └── jakarta
│ └── tck
│ └── authentication
│ └── test
│ └── dispatching
│ ├── BasicForwardTest.java
│ └── BasicIncludeTest.java
├── ejb-propagation
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── ee
│ │ │ └── jakarta
│ │ │ └── tck
│ │ │ └── authentication
│ │ │ └── test
│ │ │ └── ejbpropagation
│ │ │ ├── ejb
│ │ │ ├── ProtectedEJB.java
│ │ │ └── PublicEJB.java
│ │ │ ├── sam
│ │ │ ├── SamAutoRegistrationListener.java
│ │ │ └── TestServerAuthModule.java
│ │ │ └── servlet
│ │ │ ├── ProtectedServletProtectedEJB.java
│ │ │ ├── ProtectedServletPublicEJB.java
│ │ │ ├── PublicServletProtectedEJB.java
│ │ │ ├── PublicServletPublicEJB.java
│ │ │ └── PublicServletPublicEJBLogout.java
│ └── webapp
│ │ └── WEB-INF
│ │ └── web.xml
│ └── test
│ └── java
│ └── ee
│ └── jakarta
│ └── tck
│ └── authentication
│ └── test
│ └── ejbpropagation
│ ├── ProtectedEJBPropagationTest.java
│ ├── PublicEJBPropagationLogoutTest.java
│ └── PublicEJBPropagationTest.java
├── ejb-register-session
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── ee
│ │ │ └── jakarta
│ │ │ └── tck
│ │ │ └── authentication
│ │ │ └── test
│ │ │ └── registersession
│ │ │ ├── ejb
│ │ │ ├── ProtectedEJB.java
│ │ │ └── PublicEJB.java
│ │ │ ├── sam
│ │ │ ├── MyPrincipal.java
│ │ │ ├── SamAutoRegistrationListener.java
│ │ │ └── TestServerAuthModule.java
│ │ │ └── servlet
│ │ │ ├── ProtectedServlet.java
│ │ │ ├── PublicServlet.java
│ │ │ ├── PublicServletProtectedEJB.java
│ │ │ └── PublicServletPublicEJB.java
│ └── webapp
│ │ └── WEB-INF
│ │ └── web.xml
│ └── test
│ └── java
│ └── ee
│ └── jakarta
│ └── tck
│ └── authentication
│ └── test
│ └── registersession
│ ├── RegisterSessionCustomPrincipalEJBPropagationTest.java
│ └── RegisterSessionEJBPropagationTest.java
├── invoke-ejb-cdi
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── ee
│ │ │ └── jakarta
│ │ │ └── tck
│ │ │ └── authentication
│ │ │ └── test
│ │ │ └── invoke
│ │ │ ├── bean
│ │ │ ├── CDIBean.java
│ │ │ └── EJBBean.java
│ │ │ ├── sam
│ │ │ ├── SamAutoRegistrationListener.java
│ │ │ └── TestServerAuthModule.java
│ │ │ └── servlet
│ │ │ ├── ProtectedServlet.java
│ │ │ └── PublicServlet.java
│ └── webapp
│ │ └── WEB-INF
│ │ ├── beans.xml
│ │ └── web.xml
│ └── test
│ └── java
│ └── ee
│ └── jakarta
│ └── tck
│ └── authentication
│ └── test
│ └── invoke
│ ├── InvokeCDIBeanProtectedTest.java
│ ├── InvokeCDIBeanPublicTest.java
│ ├── InvokeEJBBeanProtectedTest.java
│ └── InvokeEJBBeanPublicTest.java
├── jacc-propagation
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── ee
│ │ │ └── jakarta
│ │ │ └── tck
│ │ │ └── authentication
│ │ │ └── test
│ │ │ └── authzpropagation
│ │ │ ├── jacc
│ │ │ └── JakartaAuthorization.java
│ │ │ ├── sam
│ │ │ ├── SamAutoRegistrationListener.java
│ │ │ └── TestServerAuthModule.java
│ │ │ └── servlet
│ │ │ ├── ProtectedServlet.java
│ │ │ └── PublicServlet.java
│ └── webapp
│ │ └── WEB-INF
│ │ └── web.xml
│ └── test
│ └── java
│ └── ee
│ └── jakarta
│ └── tck
│ └── authentication
│ └── test
│ └── authzpropagation
│ ├── AuthzPropagationProtectedTest.java
│ └── AuthzPropagationPublicTest.java
├── lifecycle
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── ee
│ │ │ └── jakarta
│ │ │ └── tck
│ │ │ └── authentication
│ │ │ └── test
│ │ │ └── lifecycle
│ │ │ ├── sam
│ │ │ ├── SamAutoRegistrationListener.java
│ │ │ └── TestLifecycleAuthModule.java
│ │ │ └── servlet
│ │ │ ├── ProtectedServlet.java
│ │ │ └── PublicServlet.java
│ └── webapp
│ │ └── WEB-INF
│ │ └── web.xml
│ └── test
│ └── java
│ └── ee
│ └── jakarta
│ └── tck
│ └── authentication
│ └── test
│ └── lifecycle
│ ├── AuthModuleMethodInvocationTest.java
│ └── IsMandatoryTest.java
├── pom.xml
├── programmatic-authentication
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── ee
│ │ │ └── jakarta
│ │ │ └── tck
│ │ │ └── authentication
│ │ │ └── test
│ │ │ └── programmaticauthentication
│ │ │ ├── sam
│ │ │ ├── SamAutoRegistrationListener.java
│ │ │ └── TestServerAuthModule.java
│ │ │ └── servlet
│ │ │ └── AuthenticateServlet.java
│ └── webapp
│ │ └── WEB-INF
│ │ └── web.xml
│ └── test
│ └── java
│ └── ee
│ └── jakarta
│ └── tck
│ └── authentication
│ └── test
│ └── programmaticauthentication
│ └── ProgrammaticAuthenticationTest.java
├── register-session
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── ee
│ │ │ └── jakarta
│ │ │ └── tck
│ │ │ └── authentication
│ │ │ └── test
│ │ │ └── registersession
│ │ │ ├── sam
│ │ │ ├── MyPrincipal.java
│ │ │ ├── SamAutoRegistrationListener.java
│ │ │ └── TestServerAuthModule.java
│ │ │ └── servlet
│ │ │ ├── ProtectedServlet.java
│ │ │ └── PublicServlet.java
│ └── webapp
│ │ └── WEB-INF
│ │ └── web.xml
│ └── test
│ └── java
│ └── ee
│ └── jakarta
│ └── tck
│ └── authentication
│ └── test
│ └── registersession
│ ├── RegisterSessionCustomPrincipalTest.java
│ └── RegisterSessionTest.java
├── spi
├── JavadocAssertions.html
├── SpecAssertions.html
├── common
│ ├── ProviderConfiguration.xml
│ ├── pom.xml
│ ├── provider-configuration.xsd
│ └── src
│ │ └── main
│ │ ├── java
│ │ └── ee
│ │ │ └── jakarta
│ │ │ └── tck
│ │ │ └── authentication
│ │ │ └── test
│ │ │ └── basic
│ │ │ ├── sam
│ │ │ ├── AuthDataCallbackHandler.java
│ │ │ ├── CommonCallbackSupport.java
│ │ │ ├── ProviderConfigurationEntry.java
│ │ │ ├── ProviderConfigurationXMLFileProcessor.java
│ │ │ ├── ServerCallbackSupport.java
│ │ │ ├── TSAuthConfigProviderServlet.java
│ │ │ ├── TSFileHandler.java
│ │ │ ├── config
│ │ │ │ ├── SOAPTSServerAuthConfig.java
│ │ │ │ ├── TSAuthConfigFactory.java
│ │ │ │ ├── TSAuthConfigFactoryForStandalone.java
│ │ │ │ ├── TSAuthConfigProvider.java
│ │ │ │ ├── TSAuthConfigProviderStandalone.java
│ │ │ │ ├── TSClientAuthConfig.java
│ │ │ │ ├── TSClientAuthContext.java
│ │ │ │ ├── TSRegistrationListener.java
│ │ │ │ ├── TSServerAuthConfig.java
│ │ │ │ └── TSServerAuthContext.java
│ │ │ ├── module
│ │ │ │ ├── servlet
│ │ │ │ │ ├── TSClientAuthModule.java
│ │ │ │ │ ├── TSRequestWrapper.java
│ │ │ │ │ ├── TSResponseWrapper.java
│ │ │ │ │ ├── TSServerAuthModule.java
│ │ │ │ │ └── TSServletWrapperSAM.java
│ │ │ │ └── soap
│ │ │ │ │ ├── ClientCallbackSupport.java
│ │ │ │ │ ├── TSAuthExceptionClientAuthModule.java
│ │ │ │ │ ├── TSAuthExceptionServerAuthModule.java
│ │ │ │ │ ├── TSClientAuthModule.java
│ │ │ │ │ ├── TSFailureClientAuthModule.java
│ │ │ │ │ ├── TSFailureServerAuthModule.java
│ │ │ │ │ ├── TSSendFailureClientAuthModule.java
│ │ │ │ │ ├── TSSendFailureServerAuthModule.java
│ │ │ │ │ ├── TSSendSuccessClientAuthModule.java
│ │ │ │ │ ├── TSSendSuccessServerAuthModule.java
│ │ │ │ │ └── TSServerAuthModule.java
│ │ │ └── util
│ │ │ │ ├── BASE64Decoder.java
│ │ │ │ ├── CEFormatException.java
│ │ │ │ ├── CEStreamExhausted.java
│ │ │ │ └── CharacterDecoder.java
│ │ │ └── servlet
│ │ │ ├── CommonTests.java
│ │ │ ├── CommonUtils.java
│ │ │ ├── IdUtil.java
│ │ │ └── JASPICData.java
│ │ ├── resources
│ │ └── META-INF
│ │ │ └── services
│ │ │ └── jakarta.servlet.ServletContainerInitializer
│ │ └── webapp
│ │ └── WEB-INF
│ │ └── web.xml
├── pom.xml
├── servlet
│ ├── auth.conf
│ ├── pom.xml
│ └── src
│ │ ├── main
│ │ ├── java
│ │ │ └── ee
│ │ │ │ └── jakarta
│ │ │ │ └── tck
│ │ │ │ └── authentication
│ │ │ │ └── test
│ │ │ │ └── basic
│ │ │ │ └── servlet
│ │ │ │ ├── ACFTestServlet.java
│ │ │ │ ├── AnotherMandatoryAuthen.java
│ │ │ │ ├── AuthFactoryContainerInitializer.java
│ │ │ │ ├── AuthStatusMandatorySuccess.java
│ │ │ │ ├── ModTestServlet.java
│ │ │ │ ├── OpenToAllServlet.java
│ │ │ │ ├── OptionalAuthen.java
│ │ │ │ └── WrapperServlet.java
│ │ ├── resources
│ │ │ └── META-INF
│ │ │ │ └── services
│ │ │ │ └── jakarta.servlet.ServletContainerInitializer
│ │ └── webapp
│ │ │ └── WEB-INF
│ │ │ └── web.xml
│ │ └── test
│ │ └── java
│ │ └── ee
│ │ └── jakarta
│ │ └── tck
│ │ └── authentication
│ │ └── test
│ │ └── basic
│ │ ├── ServletProfileSPITest.java
│ │ └── ServletUnitTest.java
└── soap
│ ├── auth.conf
│ ├── pom.xml
│ └── src
│ ├── main
│ ├── java
│ │ └── ee
│ │ │ └── jakarta
│ │ │ └── tck
│ │ │ └── authentication
│ │ │ └── test
│ │ │ └── basic
│ │ │ └── soap
│ │ │ ├── AuthFactoryContainerInitializer.java
│ │ │ ├── Hello.java
│ │ │ ├── HelloImpl.java
│ │ │ ├── HelloService.java
│ │ │ ├── ObjectFactory.java
│ │ │ ├── SayHelloProtected.java
│ │ │ ├── SayHelloProtectedResponse.java
│ │ │ └── package-info.java
│ ├── resources
│ │ └── META-INF
│ │ │ └── services
│ │ │ ├── com.sun.xml.ws.assembler.metro.dev.ClientPipelineHook
│ │ │ └── jakarta.servlet.ServletContainerInitializer
│ └── webapp
│ │ └── WEB-INF
│ │ ├── HelloService.wsdl
│ │ ├── HelloService_schema1.xsd
│ │ ├── soap-web.xml
│ │ └── web.xml
│ └── test
│ └── java
│ └── ee
│ └── jakarta
│ └── tck
│ └── authentication
│ └── test
│ └── basic
│ ├── SoapProfileSPITest.java
│ └── SoapUnitTest.java
├── status-codes
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── ee
│ │ │ └── jakarta
│ │ │ └── tck
│ │ │ └── authentication
│ │ │ └── test
│ │ │ └── statuscodes
│ │ │ ├── sam
│ │ │ ├── SamAutoRegistrationListener.java
│ │ │ └── TestServerAuthModule.java
│ │ │ └── servlet
│ │ │ ├── ProtectedServlet.java
│ │ │ └── PublicServlet.java
│ └── webapp
│ │ └── WEB-INF
│ │ └── web.xml
│ └── test
│ └── java
│ └── ee
│ └── jakarta
│ └── tck
│ └── authentication
│ └── test
│ └── statuscodes
│ ├── ProtectedStatusCodesTest.java
│ └── PublicStatusCodesTest.java
└── wrapping
├── pom.xml
└── src
├── main
├── java
│ └── ee
│ │ └── jakarta
│ │ └── tck
│ │ └── authentication
│ │ └── test
│ │ └── wrapping
│ │ ├── sam
│ │ ├── SamAutoRegistrationListener.java
│ │ └── TestWrappingServerAuthModule.java
│ │ └── servlet
│ │ ├── DeclaredFilter.java
│ │ ├── ProgrammaticFilter.java
│ │ ├── ProtectedServlet.java
│ │ ├── TestHttpServletRequestWrapper.java
│ │ └── TestHttpServletResponseWrapper.java
└── webapp
│ └── WEB-INF
│ └── web.xml
└── test
└── java
└── ee
└── jakarta
└── tck
└── authentication
└── test
└── wrapping
└── WrappingTest.java
/.github/ISSUE_TEMPLATE/tck_challenge.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: TCK Challenge
3 | about: Create a TCK Challenge
4 | title: ''
5 | labels: 'challenge'
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Challenged tests**
11 | List the challenged tests with the fully qualified classnames and then the test methods, e.g.
12 | ee.jakarta.tck.faces.test.javaee7.multiFieldValidation.Spec1IT#testFailingPreconditionsNotAfterAllInputComponents
13 |
14 | **TCK Version**
15 | Specify the version of the TCK, e.g. Jakarta Faces 4.0.x
16 |
17 | **Description**
18 | A clear and concise description of why you think the tests are wrong.
19 |
20 | **Additional context**
21 | Add any other context about the challenge here.
22 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | target/
2 | .classpath
3 | .project
4 | .settings/
5 | *.iml
6 | *nbactions.xml
7 | .vscode/
8 | .idea
9 | nb-configuration.xml
--------------------------------------------------------------------------------
/NOTICE.md:
--------------------------------------------------------------------------------
1 | # Notices for Jakarta Authentication
2 |
3 | This content is produced and maintained by the Jakarta Authentication
4 | project.
5 |
6 | * Project home: https://projects.eclipse.org/projects/ee4j.jaspic
7 |
8 | ## Trademarks
9 |
10 | Jakarta Authentication is a trademark of the Eclipse Foundation.
11 |
12 | ## Copyright
13 |
14 | All content is the property of the respective authors or their employers. For
15 | more information regarding authorship of content, please consult the listed
16 | source code repository logs.
17 |
18 | ## Declared Project Licenses
19 |
20 | This program and the accompanying materials are made available under the terms
21 | of the Eclipse Public License v. 2.0 which is available at
22 | http://www.eclipse.org/legal/epl-2.0. This Source Code may also be made
23 | available under the following Secondary Licenses when the conditions for such
24 | availability set forth in the Eclipse Public License v. 2.0 are satisfied: GNU
25 | General Public License, version 2 with the GNU Classpath Exception which is
26 | available at https://www.gnu.org/software/classpath/license.html.
27 |
28 | SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
29 |
30 | ## Source Code
31 |
32 | The project maintains the following source code repositories:
33 |
34 | * https://github.com/eclipse-ee4j/jaspic
35 |
36 | ## Third-party Content
37 |
38 | ## Cryptography
39 |
40 | Content may contain encryption software. The country in which you are currently
41 | may have restrictions on the import, possession, and use, and/or re-export to
42 | another country, of encryption software. BEFORE using any encryption software,
43 | please check the country's laws, regulations and policies concerning the import,
44 | possession, or use, and re-export of encryption software, to see if this is
45 | permitted.
46 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Jakarta Authentication
2 |
3 | This repository contains the code for Jakarta Authentication.
4 |
5 | [Online JavaDoc](https://javadoc.io/doc/jakarta.security.auth.message/jakarta.security.auth.message-api/)
6 |
7 | Building
8 | --------
9 |
10 | Jakarta Authentication can be built by executing the following from the project root:
11 |
12 | ``mvn clean package``
13 |
14 | The API jar can then be found in /api/target.
15 |
16 | Making Changes
17 | --------------
18 |
19 | To make changes, fork this repository, make your changes, and submit a pull request.
20 |
21 | About Jakarta Authentication
22 | -------------
23 |
24 | Jakarta Authentication defines a general low-level SPI for authentication mechanisms, which are controllers that interact with a caller and a container's environment to obtain the caller's credentials, validate these, and pass an authenticated identity (such as name and groups) to the container.
25 |
26 | Jakarta Authentication consists of several profiles, with each profile telling how a specific container
27 | (such as Jakarta Servlet) can integrate with- and adapt to this SPI.
28 |
--------------------------------------------------------------------------------
/api/.gitignore:
--------------------------------------------------------------------------------
1 | /.flattened-pom.xml
2 |
--------------------------------------------------------------------------------
/api/src/main/java/jakarta/security/auth/message/callback/CertStoreCallback.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates and others.
3 | * All rights reserved.
4 | *
5 | * This program and the accompanying materials are made available under the
6 | * terms of the Eclipse Public License v. 2.0, which is available at
7 | * http://www.eclipse.org/legal/epl-2.0.
8 | *
9 | * This Source Code may also be made available under the following Secondary
10 | * Licenses when the conditions for such availability set forth in the
11 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
12 | * version 2 with the GNU Classpath Exception, which is available at
13 | * https://www.gnu.org/software/classpath/license.html.
14 | *
15 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16 | */
17 |
18 | package jakarta.security.auth.message.callback;
19 |
20 | import java.security.cert.CertStore;
21 | import javax.security.auth.callback.Callback;
22 |
23 | /**
24 | * Callback for CertStore.
25 | *
26 | *
27 | * A CertStore is a generic repository for certificates. CertStores may be searched to locate public key certificates,
28 | * as well as to put together certificate chains. Such a search may be necessary when the caller needs to verify a
29 | * signature.
30 | *
31 | */
32 | public class CertStoreCallback implements Callback {
33 |
34 | private CertStore certStore;
35 |
36 | /**
37 | * Used by the CallbackHandler to set the CertStore within the Callback.
38 | *
39 | * @param certStore The certificate store, which may be null
40 | */
41 | public void setCertStore(CertStore certStore) {
42 | this.certStore = certStore;
43 | }
44 |
45 | /**
46 | * Used by the CertStore user to obtain the CertStore set within the Callback.
47 | *
48 | * @return The CertStore, or null.
49 | */
50 | public CertStore getCertStore() {
51 | return certStore;
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/api/src/main/java/jakarta/security/auth/message/callback/TrustStoreCallback.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates and others.
3 | * All rights reserved.
4 | *
5 | * This program and the accompanying materials are made available under the
6 | * terms of the Eclipse Public License v. 2.0, which is available at
7 | * http://www.eclipse.org/legal/epl-2.0.
8 | *
9 | * This Source Code may also be made available under the following Secondary
10 | * Licenses when the conditions for such availability set forth in the
11 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
12 | * version 2 with the GNU Classpath Exception, which is available at
13 | * https://www.gnu.org/software/classpath/license.html.
14 | *
15 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16 | */
17 |
18 | package jakarta.security.auth.message.callback;
19 |
20 | import java.security.KeyStore;
21 | import javax.security.auth.callback.Callback;
22 |
23 | /**
24 | * Callback for trusted certificate KeyStore.
25 | *
26 | *
27 | * A trusted certificate KeyStore may be used to determine whether a given certificate chain can be trusted.
28 | *
29 | */
30 | public class TrustStoreCallback implements Callback {
31 |
32 | private KeyStore trustStore;
33 |
34 | /**
35 | * Used by the CallbackHandler to set the trusted certificate keystore within the Callback.
36 | *
37 | * @param trustStore The trusted certificate KeyStore, which must already be loaded.
38 | */
39 | public void setTrustStore(KeyStore trustStore) {
40 | this.trustStore = trustStore;
41 | }
42 |
43 | /**
44 | * Used by the TrustStore user to obtain the TrustStore set within the Callback.
45 | *
46 | * @return The trusted certificate KeyStore. The KeyStore is guaranteed to already be loaded.
47 | */
48 | public KeyStore getTrustStore() {
49 | return trustStore;
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/api/src/main/java/jakarta/security/auth/message/callback/package.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
54 |
55 |
--------------------------------------------------------------------------------
/tck-dist/userguide/src/main/jbake/templates/menu.ftl:
--------------------------------------------------------------------------------
1 | <#-- a menu bar template fragment included in the page template -->
--------------------------------------------------------------------------------
/tck-dist/userguide/src/main/jbake/templates/page.ftl:
--------------------------------------------------------------------------------
1 | <#-- a top level page layout template -->
2 |
3 | <#include "header.ftl">
4 | <#include "menu.ftl">
5 |
6 | ${content.body}
7 |
8 | <#include "footer.ftl">
--------------------------------------------------------------------------------
/tck/async-authentication/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 | 4.0.0
20 |
21 |
22 | org.eclipse.ee4j.tck.authentication
23 | jakarta-authentication-tck
24 | 3.1.0-SNAPSHOT
25 |
26 |
27 | async-authentication
28 | war
29 |
30 | Jakarta Authentication TCK - async-authentication
31 |
32 |
33 |
34 | org.jakartaee
35 | jaspic-common
36 | 1.0-SNAPSHOT
37 |
38 |
39 |
40 |
41 |
42 |
43 | org.apache.maven.plugins
44 | maven-surefire-plugin
45 |
46 | ${skipEJB}
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/tck/async-authentication/src/main/java/ee/jakarta/tck/authentication/test/ejbasyncauthentication/bean/AsyncBean.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.ejbasyncauthentication.bean;
17 |
18 | import static java.lang.Thread.interrupted;
19 | import static java.lang.Thread.sleep;
20 |
21 | import java.io.IOException;
22 |
23 | import jakarta.ejb.Asynchronous;
24 | import jakarta.ejb.Stateless;
25 | import jakarta.servlet.AsyncContext;
26 |
27 | /**
28 | *
29 | * @author Arjan Tijms
30 | *
31 | */
32 | @Stateless
33 | public class AsyncBean {
34 |
35 | @Asynchronous
36 | public void doAsync(AsyncContext asyncContext) {
37 |
38 | try {
39 | sleep(1000);
40 | } catch (InterruptedException e) {
41 | interrupted();
42 | }
43 |
44 | try {
45 | asyncContext.getResponse().getWriter().write("async response");
46 | } catch (IOException e) {
47 | e.printStackTrace();
48 | }
49 |
50 | asyncContext.complete();
51 | }
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/tck/async-authentication/src/main/java/ee/jakarta/tck/authentication/test/ejbasyncauthentication/sam/SamAutoRegistrationListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.ejbasyncauthentication.sam;
17 |
18 | import jakarta.security.auth.message.config.AuthConfigFactory;
19 | import jakarta.servlet.ServletContextEvent;
20 | import jakarta.servlet.ServletContextListener;
21 | import jakarta.servlet.annotation.WebListener;
22 |
23 | /**
24 | *
25 | * @author Arjan Tijms
26 | *
27 | */
28 | @WebListener
29 | public class SamAutoRegistrationListener implements ServletContextListener {
30 |
31 | @Override
32 | public void contextInitialized(ServletContextEvent sce) {
33 | AuthConfigFactory.getFactory()
34 | .registerServerAuthModule(new TestServerAuthModule(), sce.getServletContext());
35 | }
36 |
37 | }
--------------------------------------------------------------------------------
/tck/async-authentication/src/main/java/ee/jakarta/tck/authentication/test/ejbasyncauthentication/servlet/AsyncServlet.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.ejbasyncauthentication.servlet;
17 |
18 | import java.io.IOException;
19 |
20 | import ee.jakarta.tck.authentication.test.ejbasyncauthentication.bean.AsyncBean;
21 | import jakarta.ejb.EJB;
22 | import jakarta.servlet.AsyncContext;
23 | import jakarta.servlet.ServletException;
24 | import jakarta.servlet.annotation.WebServlet;
25 | import jakarta.servlet.http.HttpServlet;
26 | import jakarta.servlet.http.HttpServletRequest;
27 | import jakarta.servlet.http.HttpServletResponse;
28 |
29 | /**
30 | *
31 | * @author Arjan Tijms
32 | *
33 | */
34 | @WebServlet(urlPatterns = "/public/asyncServlet", asyncSupported = true)
35 | public class AsyncServlet extends HttpServlet {
36 |
37 | private static final long serialVersionUID = 1L;
38 |
39 | @EJB
40 | private AsyncBean asyncBean;
41 |
42 | @Override
43 | public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
44 |
45 | AsyncContext asyncContext = request.startAsync();
46 | asyncContext.setTimeout(5000);
47 |
48 | asyncBean.doAsync(asyncContext);
49 | }
50 |
51 | }
--------------------------------------------------------------------------------
/tck/async-authentication/src/main/webapp/WEB-INF/web.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
21 |
22 |
23 |
24 | Test
25 | /protected/*
26 |
27 |
28 | architect
29 |
30 |
31 |
32 |
33 | architect
34 |
35 |
36 |
--------------------------------------------------------------------------------
/tck/async-authentication/src/test/java/ee/jakarta/tck/authentication/test/ejbasyncauthentication/AsyncAuthenticationPublicTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.ejbasyncauthentication;
17 |
18 | import static org.junit.Assert.assertTrue;
19 |
20 | import java.io.IOException;
21 |
22 | import org.jboss.arquillian.container.test.api.Deployment;
23 | import org.jboss.arquillian.junit.Arquillian;
24 | import org.jboss.shrinkwrap.api.Archive;
25 | import org.junit.Test;
26 | import org.junit.runner.RunWith;
27 |
28 | import ee.jakarta.tck.authentication.test.common.ArquillianBase;
29 |
30 | /**
31 | *
32 | *
33 | * @author Arjan Tijms
34 | *
35 | */
36 | @RunWith(Arquillian.class)
37 | public class AsyncAuthenticationPublicTest extends ArquillianBase {
38 |
39 | @Deployment(testable = false)
40 | public static Archive> createDeployment() {
41 | return defaultArchive();
42 | }
43 |
44 | /**
45 | * This tests that an async response works at all in the mere presence of
46 | * a JASPIC SAM (that does nothing)
47 | */
48 | @Test
49 | public void testBasicAsync() throws IOException {
50 | String response = getFromServerPath("public/asyncServlet");
51 | assertTrue(response.contains("async response"));
52 | }
53 |
54 | }
--------------------------------------------------------------------------------
/tck/authentication-signaturetest/src/test/java/ee/jakarta/tck/authentication/signaturetest/SigTestData.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 |
17 |
18 | package ee.jakarta.tck.authentication.signaturetest;
19 |
20 | import java.util.Properties;
21 |
22 | /**
23 | * This class holds the data passed to a signature test invocation during the
24 | * setup phase. This allows us to keep the passed data separate and reuse the
25 | * data between the signature test framework base classes.
26 | */
27 | public class SigTestData {
28 |
29 | private Properties props;
30 |
31 | public SigTestData() {
32 | this.props = System.getProperties();;
33 | }
34 |
35 | public String getTestClasspath() {
36 | return props.getProperty("signature.sigTestClasspath", "");
37 | }
38 |
39 | public String getProperty(String prop) {
40 | return props.getProperty(prop);
41 | }
42 |
43 | public String getOptionalTechPackagesToIgnore() {
44 | return props.getProperty("optional.tech.packages.to.ignore", "jakarta.xml.bind");
45 | }
46 |
47 | public String getJImageDir() {
48 | return props.getProperty("jimage.dir", "");
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/tck/authentication-signaturetest/src/test/resources/ee/jakarta/tck/authentication/signaturetest/sig-test-pkg-list.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2018, 2022 Oracle and/or its affiliates. All rights reserved.
3 | #
4 | # This program and the accompanying materials are made available under the
5 | # terms of the Eclipse Public License v. 2.0, which is available at
6 | # http://www.eclipse.org/legal/epl-2.0.
7 | #
8 | # This Source Code may also be made available under the following Secondary
9 | # Licenses when the conditions for such availability set forth in the
10 | # Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | # version 2 with the GNU Classpath Exception, which is available at
12 | # https://www.gnu.org/software/classpath/license.html.
13 | #
14 | # SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | #
16 |
17 | ##
18 | # This file contains a list of all the packages
19 | # contained in the signature files for this
20 | # deliverable. This file is used to exclude valid
21 | # sub-packages from being verified when their
22 | # parent package's signature is checked.
23 | ##
24 |
25 |
26 | jakarta.security.auth.message
27 | jakarta.security.auth.message.callback
28 | jakarta.security.auth.message.config
29 | jakarta.security.auth.message.module
30 |
--------------------------------------------------------------------------------
/tck/authentication-signaturetest/src/test/resources/ee/jakarta/tck/authentication/signaturetest/sig-test.map:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved.
3 | #
4 | # This program and the accompanying materials are made available under the
5 | # terms of the Eclipse Public License v. 2.0, which is available at
6 | # http://www.eclipse.org/legal/epl-2.0.
7 | #
8 | # This Source Code may also be made available under the following Secondary
9 | # Licenses when the conditions for such availability set forth in the
10 | # Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | # version 2 with the GNU Classpath Exception, which is available at
12 | # https://www.gnu.org/software/classpath/license.html.
13 | #
14 | # SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | #
16 |
17 | ###############################################################
18 | # The signature test mapping file for the Faces TCK. This file
19 | # should be formatted as a standard java properties file. The
20 | # name is the package name and the value is the version of the
21 | # package that should be tested by the signature tests.
22 | ###############################################################
23 |
24 | jakarta.security.auth.message=3.1.0-SNAPSHOT
25 |
--------------------------------------------------------------------------------
/tck/basic-authentication/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 | 4.0.0
20 |
21 |
22 | org.eclipse.ee4j.tck.authentication
23 | jakarta-authentication-tck
24 | 3.1.0-SNAPSHOT
25 |
26 |
27 | basic-authentication
28 | war
29 |
30 | Jakarta Authentication TCK - basic-authentication
31 |
32 |
33 |
34 | org.jakartaee
35 | jaspic-common
36 | 1.0-SNAPSHOT
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/tck/basic-authentication/src/main/java/ee/jakarta/tck/authentication/test/basic/sam/SamAutoRegistrationListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.basic.sam;
17 |
18 | import jakarta.security.auth.message.config.AuthConfigFactory;
19 | import jakarta.servlet.ServletContextEvent;
20 | import jakarta.servlet.ServletContextListener;
21 | import jakarta.servlet.annotation.WebListener;
22 |
23 | /**
24 | *
25 | * @author Arjan Tijms
26 | *
27 | */
28 | @WebListener
29 | public class SamAutoRegistrationListener implements ServletContextListener {
30 |
31 | @Override
32 | public void contextInitialized(ServletContextEvent sce) {
33 | AuthConfigFactory.getFactory()
34 | .registerServerAuthModule(new TestServerAuthModule(), sce.getServletContext());
35 | }
36 |
37 | }
--------------------------------------------------------------------------------
/tck/basic-authentication/src/main/java/ee/jakarta/tck/authentication/test/basic/servlet/ProtectedServlet.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.basic.servlet;
17 |
18 | import java.io.IOException;
19 |
20 | import jakarta.servlet.ServletException;
21 | import jakarta.servlet.annotation.WebServlet;
22 | import jakarta.servlet.http.HttpServlet;
23 | import jakarta.servlet.http.HttpServletRequest;
24 | import jakarta.servlet.http.HttpServletResponse;
25 |
26 | /**
27 | *
28 | * @author Arjan Tijms
29 | *
30 | */
31 | @WebServlet(urlPatterns = "/protected/servlet")
32 | public class ProtectedServlet extends HttpServlet {
33 |
34 | private static final long serialVersionUID = 1L;
35 |
36 | @Override
37 | public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
38 |
39 | response.getWriter().write("This is a protected servlet \n");
40 |
41 | String webName = null;
42 | if (request.getUserPrincipal() != null) {
43 | webName = request.getUserPrincipal().getName();
44 | }
45 |
46 | response.getWriter().write("web username: " + webName + "\n");
47 |
48 | boolean webHasRole = request.isUserInRole("architect");
49 |
50 | response.getWriter().write("web user has role \"architect\": " + webHasRole + "\n");
51 |
52 | }
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/tck/basic-authentication/src/main/java/ee/jakarta/tck/authentication/test/basic/servlet/PublicServlet.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.basic.servlet;
17 |
18 | import java.io.IOException;
19 |
20 | import jakarta.servlet.ServletException;
21 | import jakarta.servlet.annotation.WebServlet;
22 | import jakarta.servlet.http.HttpServlet;
23 | import jakarta.servlet.http.HttpServletRequest;
24 | import jakarta.servlet.http.HttpServletResponse;
25 |
26 | /**
27 | *
28 | * @author Arjan Tijms
29 | *
30 | */
31 | @WebServlet(urlPatterns = "/public/servlet")
32 | public class PublicServlet extends HttpServlet {
33 |
34 | private static final long serialVersionUID = 1L;
35 |
36 | @Override
37 | public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
38 |
39 | response.getWriter().write("This is a public servlet \n");
40 |
41 | String webName = null;
42 | if (request.getUserPrincipal() != null) {
43 | webName = request.getUserPrincipal().getName();
44 | }
45 |
46 | response.getWriter().write("web username: " + webName + "\n");
47 |
48 | boolean webHasRole = request.isUserInRole("architect");
49 |
50 | response.getWriter().write("web user has role \"architect\": " + webHasRole + "\n");
51 |
52 | }
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/tck/basic-authentication/src/main/webapp/WEB-INF/web.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
21 |
22 |
23 |
24 | Test
25 | /protected/*
26 |
27 |
28 | architect
29 |
30 |
31 |
32 |
33 | architect
34 |
35 |
36 |
--------------------------------------------------------------------------------
/tck/custom-principal/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 | 4.0.0
20 |
21 |
22 | org.eclipse.ee4j.tck.authentication
23 | jakarta-authentication-tck
24 | 3.1.0-SNAPSHOT
25 |
26 |
27 | custom-principal
28 | war
29 |
30 | Jakarta Authentication TCK - custom principal
31 |
32 |
33 |
34 | org.jakartaee
35 | jaspic-common
36 | 1.0-SNAPSHOT
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/tck/custom-principal/src/main/java/ee/jakarta/tck/authentication/test/customprincipal/sam/MyPrincipal.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.customprincipal.sam;
17 |
18 | import java.security.Principal;
19 |
20 | /**
21 | *
22 | * @author Arjan Tijms
23 | *
24 | */
25 | public class MyPrincipal implements Principal {
26 |
27 | private final String name;
28 |
29 | public MyPrincipal(String name) {
30 | this.name = name;
31 | }
32 |
33 | @Override
34 | public String getName() {
35 | return name;
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/tck/custom-principal/src/main/java/ee/jakarta/tck/authentication/test/customprincipal/sam/SamAutoRegistrationListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.customprincipal.sam;
17 |
18 | import jakarta.security.auth.message.config.AuthConfigFactory;
19 | import jakarta.servlet.ServletContextEvent;
20 | import jakarta.servlet.ServletContextListener;
21 | import jakarta.servlet.annotation.WebListener;
22 |
23 | /**
24 | *
25 | * @author Arjan Tijms
26 | *
27 | */
28 | @WebListener
29 | public class SamAutoRegistrationListener implements ServletContextListener {
30 |
31 | @Override
32 | public void contextInitialized(ServletContextEvent sce) {
33 | AuthConfigFactory.getFactory()
34 | .registerServerAuthModule(new TestServerAuthModule(), sce.getServletContext());
35 | }
36 |
37 | }
--------------------------------------------------------------------------------
/tck/custom-principal/src/main/webapp/WEB-INF/web.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
21 |
22 |
23 |
24 | Test
25 | /protected/*
26 |
27 |
28 | architect
29 |
30 |
31 |
32 |
33 | architect
34 |
35 |
36 |
--------------------------------------------------------------------------------
/tck/dispatching-jsf-cdi/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 | 4.0.0
20 |
21 |
22 | org.eclipse.ee4j.tck.authentication
23 | jakarta-authentication-tck
24 | 3.1.0-SNAPSHOT
25 |
26 |
27 | dispatching-jsf-cdi
28 | war
29 |
30 | Jakarta Authentication TCK - dispatching JSF CDI
31 |
32 |
33 |
34 | org.jakartaee
35 | jaspic-common
36 | 1.0-SNAPSHOT
37 |
38 |
39 |
40 |
41 |
42 |
43 | org.apache.maven.plugins
44 | maven-surefire-plugin
45 |
46 | ${skipJSF}
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/tck/dispatching-jsf-cdi/src/main/java/ee/jakarta/tck/authentication/test/dispatching/bean/MyBean.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.dispatching.bean;
17 |
18 | import jakarta.enterprise.context.RequestScoped;
19 | import jakarta.inject.Inject;
20 | import jakarta.inject.Named;
21 | import jakarta.servlet.http.HttpServletRequest;
22 |
23 | @Named
24 | @RequestScoped
25 | public class MyBean {
26 |
27 | @Inject
28 | private HttpServletRequest request;
29 |
30 | public String getText() {
31 | return "Called from CDI\n";
32 | }
33 |
34 | public String getServletPath() {
35 | return request.getServletPath();
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/tck/dispatching-jsf-cdi/src/main/java/ee/jakarta/tck/authentication/test/dispatching/sam/SamAutoRegistrationListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.dispatching.sam;
17 |
18 | import jakarta.security.auth.message.config.AuthConfigFactory;
19 | import jakarta.servlet.ServletContextEvent;
20 | import jakarta.servlet.ServletContextListener;
21 | import jakarta.servlet.annotation.WebListener;
22 |
23 | /**
24 | *
25 | * @author Arjan Tijms
26 | *
27 | */
28 | @WebListener
29 | public class SamAutoRegistrationListener implements ServletContextListener {
30 |
31 | @Override
32 | public void contextInitialized(ServletContextEvent sce) {
33 | AuthConfigFactory.getFactory()
34 | .registerServerAuthModule(new TestServerAuthModule(), sce.getServletContext());
35 | }
36 |
37 | }
--------------------------------------------------------------------------------
/tck/dispatching-jsf-cdi/src/main/java/ee/jakarta/tck/authentication/test/dispatching/servlet/IncludedServlet.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.dispatching.servlet;
17 |
18 | import java.io.IOException;
19 |
20 | import ee.jakarta.tck.authentication.test.dispatching.bean.MyBean;
21 | import jakarta.inject.Inject;
22 | import jakarta.servlet.ServletException;
23 | import jakarta.servlet.annotation.WebServlet;
24 | import jakarta.servlet.http.HttpServlet;
25 | import jakarta.servlet.http.HttpServletRequest;
26 | import jakarta.servlet.http.HttpServletResponse;
27 |
28 | /**
29 | *
30 | * @author Arjan Tijms
31 | *
32 | */
33 | @WebServlet(urlPatterns = "/includedServlet")
34 | public class IncludedServlet extends HttpServlet {
35 |
36 | private static final long serialVersionUID = 1L;
37 |
38 | @Inject
39 | private MyBean myBean;
40 |
41 | @Override
42 | public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
43 | response.getWriter().write("response from includedServlet - " + myBean.getText());
44 | }
45 |
46 | }
--------------------------------------------------------------------------------
/tck/dispatching-jsf-cdi/src/main/java/ee/jakarta/tck/authentication/test/dispatching/servlet/ProtectedServlet.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.dispatching.servlet;
17 | import java.io.IOException;
18 |
19 | import jakarta.servlet.ServletException;
20 | import jakarta.servlet.annotation.WebServlet;
21 | import jakarta.servlet.http.HttpServlet;
22 | import jakarta.servlet.http.HttpServletRequest;
23 | import jakarta.servlet.http.HttpServletResponse;
24 |
25 | /**
26 | *
27 | * @author Arjan Tijms
28 | *
29 | */
30 | @WebServlet(urlPatterns = "/protected/servlet")
31 | public class ProtectedServlet extends HttpServlet {
32 |
33 | private static final long serialVersionUID = 1L;
34 |
35 | @Override
36 | public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
37 | response.getWriter().write("Resource invoked\n");
38 | }
39 |
40 | }
--------------------------------------------------------------------------------
/tck/dispatching-jsf-cdi/src/main/java/ee/jakarta/tck/authentication/test/dispatching/servlet/PublicServlet.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.dispatching.servlet;
17 | import java.io.IOException;
18 |
19 | import jakarta.servlet.ServletException;
20 | import jakarta.servlet.annotation.WebServlet;
21 | import jakarta.servlet.http.HttpServlet;
22 | import jakarta.servlet.http.HttpServletRequest;
23 | import jakarta.servlet.http.HttpServletResponse;
24 |
25 | /**
26 | *
27 | * @author Arjan Tijms
28 | *
29 | */
30 | @WebServlet(urlPatterns = "/public/servlet")
31 | public class PublicServlet extends HttpServlet {
32 |
33 | private static final long serialVersionUID = 1L;
34 |
35 | @Override
36 | public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
37 | response.getWriter().write("Resource invoked\n");
38 | }
39 |
40 | }
--------------------------------------------------------------------------------
/tck/dispatching-jsf-cdi/src/main/webapp/WEB-INF/beans.xml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jakartaee/authentication/1d70d3f1085dce6dd9eb8e7dfe745c02eaa2ed75/tck/dispatching-jsf-cdi/src/main/webapp/WEB-INF/beans.xml
--------------------------------------------------------------------------------
/tck/dispatching-jsf-cdi/src/main/webapp/WEB-INF/faces-config.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
--------------------------------------------------------------------------------
/tck/dispatching-jsf-cdi/src/main/webapp/WEB-INF/web.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
21 |
22 |
23 |
24 | Test
25 | /protected/*
26 |
27 |
28 | architect
29 |
30 |
31 |
32 |
33 | architect
34 |
35 |
36 |
--------------------------------------------------------------------------------
/tck/dispatching-jsf-cdi/src/main/webapp/forward-cdi.xhtml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 | Forward with CDI
7 |
8 |
9 | response from JSF forward - #{myBean.text}
10 |
11 |
12 |
--------------------------------------------------------------------------------
/tck/dispatching-jsf-cdi/src/main/webapp/forward.xhtml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 | Forward
7 |
8 |
9 | response from JSF forward
10 |
11 |
12 |
--------------------------------------------------------------------------------
/tck/dispatching-jsf-cdi/src/main/webapp/include-cdi.xhtml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
21 |
22 | Include with CDI
23 |
24 |
25 | response from JSF include - #{myBean.text}
26 |
27 |
28 |
--------------------------------------------------------------------------------
/tck/dispatching-jsf-cdi/src/main/webapp/include.xhtml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
21 |
22 | Include
23 |
24 |
25 | response from JSF include
26 |
27 |
28 |
--------------------------------------------------------------------------------
/tck/dispatching/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 | 4.0.0
20 |
21 |
22 | org.eclipse.ee4j.tck.authentication
23 | jakarta-authentication-tck
24 | 3.1.0-SNAPSHOT
25 |
26 |
27 | dispatching
28 | war
29 |
30 | Jakarta Authentication TCK - dispatching
31 |
32 |
33 |
34 | org.jakartaee
35 | jaspic-common
36 | 1.0-SNAPSHOT
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/tck/dispatching/src/main/java/ee/jakarta/tck/authentication/test/dispatching/sam/SamAutoRegistrationListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.dispatching.sam;
17 |
18 | import jakarta.security.auth.message.config.AuthConfigFactory;
19 | import jakarta.servlet.ServletContextEvent;
20 | import jakarta.servlet.ServletContextListener;
21 | import jakarta.servlet.annotation.WebListener;
22 |
23 | /**
24 | *
25 | * @author Arjan Tijms
26 | *
27 | */
28 | @WebListener
29 | public class SamAutoRegistrationListener implements ServletContextListener {
30 |
31 | @Override
32 | public void contextInitialized(ServletContextEvent sce) {
33 | AuthConfigFactory.getFactory()
34 | .registerServerAuthModule(new TestServerAuthModule(), sce.getServletContext());
35 | }
36 |
37 | }
--------------------------------------------------------------------------------
/tck/dispatching/src/main/java/ee/jakarta/tck/authentication/test/dispatching/servlet/ForwardedServlet.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.dispatching.servlet;
17 |
18 | import java.io.IOException;
19 |
20 | import jakarta.servlet.ServletException;
21 | import jakarta.servlet.annotation.WebServlet;
22 | import jakarta.servlet.http.HttpServlet;
23 | import jakarta.servlet.http.HttpServletRequest;
24 | import jakarta.servlet.http.HttpServletResponse;
25 |
26 | /**
27 | *
28 | * @author Arjan Tijms
29 | *
30 | */
31 | @WebServlet(urlPatterns = "/forwardedServlet")
32 | public class ForwardedServlet extends HttpServlet {
33 |
34 | private static final long serialVersionUID = 1L;
35 |
36 | @Override
37 | public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
38 | response.getWriter().write("response from forwardedServlet");
39 | }
40 |
41 | }
--------------------------------------------------------------------------------
/tck/dispatching/src/main/java/ee/jakarta/tck/authentication/test/dispatching/servlet/IncludedServlet.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.dispatching.servlet;
17 |
18 | import java.io.IOException;
19 |
20 | import jakarta.servlet.ServletException;
21 | import jakarta.servlet.annotation.WebServlet;
22 | import jakarta.servlet.http.HttpServlet;
23 | import jakarta.servlet.http.HttpServletRequest;
24 | import jakarta.servlet.http.HttpServletResponse;
25 |
26 | /**
27 | *
28 | * @author Arjan Tijms
29 | *
30 | */
31 | @WebServlet(urlPatterns = "/includedServlet")
32 | public class IncludedServlet extends HttpServlet {
33 |
34 | private static final long serialVersionUID = 1L;
35 |
36 | @Override
37 | public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
38 | response.getWriter().write("response from includedServlet");
39 | }
40 |
41 | }
--------------------------------------------------------------------------------
/tck/dispatching/src/main/java/ee/jakarta/tck/authentication/test/dispatching/servlet/ProtectedServlet.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.dispatching.servlet;
17 | import java.io.IOException;
18 |
19 | import jakarta.servlet.ServletException;
20 | import jakarta.servlet.annotation.WebServlet;
21 | import jakarta.servlet.http.HttpServlet;
22 | import jakarta.servlet.http.HttpServletRequest;
23 | import jakarta.servlet.http.HttpServletResponse;
24 |
25 | /**
26 | *
27 | * @author Arjan Tijms
28 | *
29 | */
30 | @WebServlet(urlPatterns = "/protected/servlet")
31 | public class ProtectedServlet extends HttpServlet {
32 |
33 | private static final long serialVersionUID = 1L;
34 |
35 | @Override
36 | public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
37 | response.getWriter().write("Resource invoked\n");
38 | }
39 |
40 | }
--------------------------------------------------------------------------------
/tck/dispatching/src/main/java/ee/jakarta/tck/authentication/test/dispatching/servlet/PublicServlet.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.dispatching.servlet;
17 | import java.io.IOException;
18 |
19 | import jakarta.servlet.ServletException;
20 | import jakarta.servlet.annotation.WebServlet;
21 | import jakarta.servlet.http.HttpServlet;
22 | import jakarta.servlet.http.HttpServletRequest;
23 | import jakarta.servlet.http.HttpServletResponse;
24 |
25 | /**
26 | *
27 | * @author Arjan Tijms
28 | *
29 | */
30 | @WebServlet(urlPatterns = "/public/servlet")
31 | public class PublicServlet extends HttpServlet {
32 |
33 | private static final long serialVersionUID = 1L;
34 |
35 | @Override
36 | public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
37 | response.getWriter().write("Resource invoked\n");
38 | }
39 |
40 | }
--------------------------------------------------------------------------------
/tck/dispatching/src/main/webapp/WEB-INF/web.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
21 |
22 |
23 |
24 | Test
25 | /protected/*
26 |
27 |
28 | architect
29 |
30 |
31 |
32 |
33 | architect
34 |
35 |
36 |
--------------------------------------------------------------------------------
/tck/ejb-propagation/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 | 4.0.0
20 |
21 |
22 | org.eclipse.ee4j.tck.authentication
23 | jakarta-authentication-tck
24 | 3.1.0-SNAPSHOT
25 |
26 |
27 | ejb-propagation
28 | war
29 |
30 | Jakarta Authentication TCK - ejb-propagation
31 |
32 |
33 |
34 | org.jakartaee
35 | jaspic-common
36 | 1.0-SNAPSHOT
37 |
38 |
39 |
40 |
41 |
42 |
43 | org.apache.maven.plugins
44 | maven-surefire-plugin
45 |
46 | ${skipEJB}
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/tck/ejb-propagation/src/main/java/ee/jakarta/tck/authentication/test/ejbpropagation/ejb/PublicEJB.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.ejbpropagation.ejb;
17 |
18 | import jakarta.annotation.Resource;
19 | import jakarta.ejb.EJBContext;
20 | import jakarta.ejb.Stateless;
21 |
22 | /**
23 | * This is a "public" EJB in the sense that all its methods should be accessible and there is no declarative role checking prior
24 | * to accessing a method.
25 | *
26 | * @author Arjan Tijms
27 | *
28 | */
29 | @Stateless
30 | public class PublicEJB {
31 |
32 | @Resource
33 | private EJBContext ejbContext;
34 |
35 | public String getUserName() {
36 | try {
37 | return ejbContext.getCallerPrincipal() != null ? ejbContext.getCallerPrincipal().getName() : null;
38 | } catch (Exception e) {
39 | e.printStackTrace();
40 | }
41 | return null;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/tck/ejb-propagation/src/main/java/ee/jakarta/tck/authentication/test/ejbpropagation/sam/SamAutoRegistrationListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.ejbpropagation.sam;
17 |
18 | import jakarta.security.auth.message.config.AuthConfigFactory;
19 | import jakarta.servlet.ServletContextEvent;
20 | import jakarta.servlet.ServletContextListener;
21 | import jakarta.servlet.annotation.WebListener;
22 |
23 | /**
24 | *
25 | * @author Arjan Tijms
26 | *
27 | */
28 | @WebListener
29 | public class SamAutoRegistrationListener implements ServletContextListener {
30 |
31 | @Override
32 | public void contextInitialized(ServletContextEvent sce) {
33 | AuthConfigFactory.getFactory()
34 | .registerServerAuthModule(new TestServerAuthModule(), sce.getServletContext());
35 | }
36 |
37 | }
--------------------------------------------------------------------------------
/tck/ejb-propagation/src/main/webapp/WEB-INF/web.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
21 |
22 |
23 |
24 | Test
25 | /protected/*
26 |
27 |
28 | architect
29 |
30 |
31 |
32 |
33 | architect
34 |
35 |
36 |
--------------------------------------------------------------------------------
/tck/ejb-register-session/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 | 4.0.0
20 |
21 |
22 | org.eclipse.ee4j.tck.authentication
23 | jakarta-authentication-tck
24 | 3.1.0-SNAPSHOT
25 |
26 |
27 | ejb-register-session
28 | war
29 |
30 | Jakarta Authentication TCK - ejb-register-session
31 |
32 |
33 |
34 | org.jakartaee
35 | jaspic-common
36 | 1.0-SNAPSHOT
37 |
38 |
39 |
40 |
41 |
42 |
43 | org.apache.maven.plugins
44 | maven-surefire-plugin
45 |
46 | ${skipEJB}
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/tck/ejb-register-session/src/main/java/ee/jakarta/tck/authentication/test/registersession/ejb/PublicEJB.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.registersession.ejb;
17 | import jakarta.annotation.Resource;
18 | import jakarta.ejb.EJBContext;
19 | import jakarta.ejb.Stateless;
20 |
21 | /**
22 | * This is a "public" EJB in the sense that all its methods should be accessible and there is no declarative role checking prior
23 | * to accessing a method.
24 | *
25 | * @author Arjan Tijms
26 | *
27 | */
28 | @Stateless
29 | public class PublicEJB {
30 |
31 | @Resource
32 | private EJBContext ejbContext;
33 |
34 | public String getUserName() {
35 | try {
36 | return ejbContext.getCallerPrincipal() != null ? ejbContext.getCallerPrincipal().getName() : null;
37 | } catch (Exception e) {
38 | e.printStackTrace();
39 | }
40 | return null;
41 | }
42 | }
--------------------------------------------------------------------------------
/tck/ejb-register-session/src/main/java/ee/jakarta/tck/authentication/test/registersession/sam/MyPrincipal.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.registersession.sam;
17 |
18 | import java.security.Principal;
19 |
20 | /**
21 | *
22 | * @author Arjan Tijms
23 | *
24 | */
25 | public class MyPrincipal implements Principal {
26 |
27 | private final String name;
28 |
29 | public MyPrincipal(String name) {
30 | this.name = name;
31 | }
32 |
33 | @Override
34 | public String getName() {
35 | return name;
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/tck/ejb-register-session/src/main/java/ee/jakarta/tck/authentication/test/registersession/sam/SamAutoRegistrationListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.registersession.sam;
17 |
18 | import jakarta.security.auth.message.config.AuthConfigFactory;
19 | import jakarta.servlet.ServletContextEvent;
20 | import jakarta.servlet.ServletContextListener;
21 | import jakarta.servlet.annotation.WebListener;
22 |
23 | /**
24 | *
25 | * @author Arjan Tijms
26 | *
27 | */
28 | @WebListener
29 | public class SamAutoRegistrationListener implements ServletContextListener {
30 |
31 | @Override
32 | public void contextInitialized(ServletContextEvent sce) {
33 | AuthConfigFactory.getFactory()
34 | .registerServerAuthModule(new TestServerAuthModule(), sce.getServletContext());
35 | }
36 |
37 | }
--------------------------------------------------------------------------------
/tck/ejb-register-session/src/main/webapp/WEB-INF/web.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
22 |
23 |
24 |
25 | Test
26 | /protected/*
27 |
28 |
29 | architect
30 |
31 |
32 |
33 |
34 | architect
35 |
36 |
37 |
--------------------------------------------------------------------------------
/tck/invoke-ejb-cdi/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 | 4.0.0
20 |
21 |
22 | org.eclipse.ee4j.tck.authentication
23 | jakarta-authentication-tck
24 | 3.1.0-SNAPSHOT
25 |
26 |
27 | invoke-ejb-cdi
28 | war
29 |
30 | Jakarta Authentication TCK - invoke EJB and CDI
31 |
32 |
33 |
34 | org.jakartaee
35 | jaspic-common
36 | 1.0-SNAPSHOT
37 |
38 |
39 |
40 |
41 |
42 |
43 | org.apache.maven.plugins
44 | maven-surefire-plugin
45 |
46 | ${skipEJB}
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/tck/invoke-ejb-cdi/src/main/java/ee/jakarta/tck/authentication/test/invoke/bean/CDIBean.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.invoke.bean;
17 |
18 | import jakarta.enterprise.context.RequestScoped;
19 | import jakarta.inject.Inject;
20 | import jakarta.inject.Named;
21 | import jakarta.servlet.http.HttpServletRequest;
22 |
23 | @Named
24 | @RequestScoped
25 | public class CDIBean {
26 |
27 | @Inject
28 | private HttpServletRequest request;
29 |
30 | public String getText() {
31 | return "Called from CDI";
32 | }
33 |
34 | public void setTextViaInjectedRequest() {
35 | request.setAttribute("text", "Called from CDI via injected request");
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/tck/invoke-ejb-cdi/src/main/java/ee/jakarta/tck/authentication/test/invoke/bean/EJBBean.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.invoke.bean;
17 |
18 | import jakarta.ejb.Stateless;
19 |
20 | @Stateless
21 | public class EJBBean {
22 |
23 | public String getText() {
24 | return "Called from EJB";
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/tck/invoke-ejb-cdi/src/main/java/ee/jakarta/tck/authentication/test/invoke/sam/SamAutoRegistrationListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.invoke.sam;
17 |
18 | import jakarta.security.auth.message.config.AuthConfigFactory;
19 | import jakarta.servlet.ServletContextEvent;
20 | import jakarta.servlet.ServletContextListener;
21 | import jakarta.servlet.annotation.WebListener;
22 |
23 | /**
24 | *
25 | * @author Arjan Tijms
26 | *
27 | */
28 | @WebListener
29 | public class SamAutoRegistrationListener implements ServletContextListener {
30 |
31 | @Override
32 | public void contextInitialized(ServletContextEvent sce) {
33 | AuthConfigFactory.getFactory()
34 | .registerServerAuthModule(new TestServerAuthModule(), sce.getServletContext());
35 | }
36 |
37 | }
--------------------------------------------------------------------------------
/tck/invoke-ejb-cdi/src/main/java/ee/jakarta/tck/authentication/test/invoke/servlet/ProtectedServlet.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.invoke.servlet;
17 | import java.io.IOException;
18 |
19 | import jakarta.servlet.ServletException;
20 | import jakarta.servlet.annotation.WebServlet;
21 | import jakarta.servlet.http.HttpServlet;
22 | import jakarta.servlet.http.HttpServletRequest;
23 | import jakarta.servlet.http.HttpServletResponse;
24 |
25 | /**
26 | *
27 | * @author Arjan Tijms
28 | *
29 | */
30 | @WebServlet(urlPatterns = "/protected/servlet")
31 | public class ProtectedServlet extends HttpServlet {
32 |
33 | private static final long serialVersionUID = 1L;
34 |
35 | @Override
36 | public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
37 | response.getWriter().write("Resource invoked\n");
38 | request.logout();
39 | }
40 |
41 | }
--------------------------------------------------------------------------------
/tck/invoke-ejb-cdi/src/main/java/ee/jakarta/tck/authentication/test/invoke/servlet/PublicServlet.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.invoke.servlet;
17 | import java.io.IOException;
18 |
19 | import jakarta.servlet.ServletException;
20 | import jakarta.servlet.annotation.WebServlet;
21 | import jakarta.servlet.http.HttpServlet;
22 | import jakarta.servlet.http.HttpServletRequest;
23 | import jakarta.servlet.http.HttpServletResponse;
24 |
25 | /**
26 | *
27 | * @author Arjan Tijms
28 | *
29 | */
30 | @WebServlet(urlPatterns = "/public/servlet")
31 | public class PublicServlet extends HttpServlet {
32 |
33 | private static final long serialVersionUID = 1L;
34 |
35 | @Override
36 | public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
37 | response.getWriter().write("Resource invoked\n");
38 | request.logout();
39 | }
40 |
41 | }
--------------------------------------------------------------------------------
/tck/invoke-ejb-cdi/src/main/webapp/WEB-INF/beans.xml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jakartaee/authentication/1d70d3f1085dce6dd9eb8e7dfe745c02eaa2ed75/tck/invoke-ejb-cdi/src/main/webapp/WEB-INF/beans.xml
--------------------------------------------------------------------------------
/tck/invoke-ejb-cdi/src/main/webapp/WEB-INF/web.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
21 |
22 |
23 |
24 | Test
25 | /protected/*
26 |
27 |
28 | architect
29 |
30 |
31 |
32 |
33 | architect
34 |
35 |
36 |
--------------------------------------------------------------------------------
/tck/jacc-propagation/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 | 4.0.0
20 |
21 |
22 | org.eclipse.ee4j.tck.authentication
23 | jakarta-authentication-tck
24 | 3.1.0-SNAPSHOT
25 |
26 |
27 | authorization-propagation
28 | war
29 |
30 | Jakarta Authentication TCK - authorization-propagation
31 |
32 |
33 |
34 | org.jakartaee
35 | jaspic-common
36 | 1.0-SNAPSHOT
37 |
38 |
39 |
40 |
41 |
42 |
43 | org.apache.maven.plugins
44 | maven-surefire-plugin
45 |
46 | ${skipJACC}
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/tck/jacc-propagation/src/main/java/ee/jakarta/tck/authentication/test/authzpropagation/jacc/JakartaAuthorization.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.authzpropagation.jacc;
17 |
18 | import static java.util.logging.Level.SEVERE;
19 |
20 | import jakarta.security.jacc.PolicyContext;
21 | import jakarta.security.jacc.PolicyFactory;
22 | import jakarta.security.jacc.WebResourcePermission;
23 | import java.util.logging.Logger;
24 | import javax.security.auth.Subject;
25 |
26 | /**
27 | *
28 | * @author Arjan Tijms
29 | *
30 | */
31 | public class JakartaAuthorization {
32 |
33 | private final static Logger logger = Logger.getLogger(JakartaAuthorization.class.getName());
34 |
35 | public static Subject getSubject() {
36 | try {
37 | return (Subject) PolicyContext.getContext("javax.security.auth.Subject.container");
38 | } catch (Exception e) {
39 | logger.log(SEVERE, "", e);
40 | }
41 |
42 | return null;
43 | }
44 |
45 | public static boolean hasAccess(String uri, Subject subject) {
46 | return PolicyFactory.getPolicyFactory().getPolicy().implies(
47 | new WebResourcePermission(uri, "GET"),
48 | subject.getPrincipals()
49 | );
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/tck/jacc-propagation/src/main/java/ee/jakarta/tck/authentication/test/authzpropagation/sam/SamAutoRegistrationListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.authzpropagation.sam;
17 |
18 | import jakarta.security.auth.message.config.AuthConfigFactory;
19 | import jakarta.servlet.ServletContextEvent;
20 | import jakarta.servlet.ServletContextListener;
21 | import jakarta.servlet.annotation.WebListener;
22 |
23 | /**
24 | *
25 | * @author Arjan Tijms
26 | *
27 | */
28 | @WebListener
29 | public class SamAutoRegistrationListener implements ServletContextListener {
30 |
31 | @Override
32 | public void contextInitialized(ServletContextEvent sce) {
33 | AuthConfigFactory.getFactory()
34 | .registerServerAuthModule(new TestServerAuthModule(), sce.getServletContext());
35 | }
36 |
37 | }
--------------------------------------------------------------------------------
/tck/jacc-propagation/src/main/java/ee/jakarta/tck/authentication/test/authzpropagation/servlet/ProtectedServlet.java:
--------------------------------------------------------------------------------
1 | package ee.jakarta.tck.authentication.test.authzpropagation.servlet;
2 |
3 | import static ee.jakarta.tck.authentication.test.authzpropagation.jacc.JakartaAuthorization.getSubject;
4 | import static ee.jakarta.tck.authentication.test.authzpropagation.jacc.JakartaAuthorization.hasAccess;
5 |
6 | import java.io.IOException;
7 |
8 | import javax.security.auth.Subject;
9 | import jakarta.servlet.ServletException;
10 | import jakarta.servlet.annotation.WebServlet;
11 | import jakarta.servlet.http.HttpServlet;
12 | import jakarta.servlet.http.HttpServletRequest;
13 | import jakarta.servlet.http.HttpServletResponse;
14 |
15 | /**
16 | *
17 | * @author Arjan Tijms
18 | *
19 | */
20 | @WebServlet(urlPatterns = "/protected/servlet")
21 | public class ProtectedServlet extends HttpServlet {
22 |
23 | private static final long serialVersionUID = 1L;
24 |
25 | @Override
26 | public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
27 |
28 | // Obtain the active subject via a JACC policy handler
29 | Subject subject = getSubject();
30 |
31 | if (subject == null) {
32 | response.getWriter().write("Can't get Subject. JACC doesn't seem to be available.");
33 | return;
34 | }
35 |
36 | // Check with JACC if the caller has access to this Servlet. As we're
37 | // currently in this very Servlet the answer can't be anything than "true" if
38 | // JASPIC, JACC and role propagation all work correctly.
39 | response.getWriter().write("Has access to /protected/servlet: " + hasAccess("/protected/servlet", subject));
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/tck/jacc-propagation/src/main/java/ee/jakarta/tck/authentication/test/authzpropagation/servlet/PublicServlet.java:
--------------------------------------------------------------------------------
1 | package ee.jakarta.tck.authentication.test.authzpropagation.servlet;
2 |
3 | import static ee.jakarta.tck.authentication.test.authzpropagation.jacc.JakartaAuthorization.getSubject;
4 | import static ee.jakarta.tck.authentication.test.authzpropagation.jacc.JakartaAuthorization.hasAccess;
5 |
6 | import java.io.IOException;
7 |
8 | import javax.security.auth.Subject;
9 | import jakarta.servlet.ServletException;
10 | import jakarta.servlet.annotation.WebServlet;
11 | import jakarta.servlet.http.HttpServlet;
12 | import jakarta.servlet.http.HttpServletRequest;
13 | import jakarta.servlet.http.HttpServletResponse;
14 |
15 | /**
16 | *
17 | * @author Arjan Tijms
18 | *
19 | */
20 | @WebServlet(urlPatterns = "/public/servlet")
21 | public class PublicServlet extends HttpServlet {
22 |
23 | private static final long serialVersionUID = 1L;
24 |
25 | @Override
26 | public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
27 |
28 | // Obtain the active subject via a JACC policy handler
29 | Subject subject = getSubject();
30 |
31 | if (subject == null) {
32 | response.getWriter().write("Can't get Subject. JACC doesn't seem to be available.");
33 | return;
34 | }
35 |
36 | // Check with JACC if the caller has access to this Servlet. As we're
37 | // currently in this very Servlet and it's a public Servlet,the answer can't be anything
38 | // than "true".
39 |
40 | response.getWriter().write("Has access to /public/servlet: " + hasAccess("/public/servlet", subject));
41 |
42 | // Check with JACC if the caller has access to another (protected) Servlet. If JACC
43 | // works correctly and we're authenticated this should be true.
44 |
45 | response.getWriter().write(
46 | "\nHas access to /protected/servlet: " + hasAccess("/protected/servlet", subject));
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/tck/jacc-propagation/src/main/webapp/WEB-INF/web.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
21 |
22 |
23 |
24 | Test
25 | /protected/*
26 |
27 |
28 | architect
29 |
30 |
31 |
32 |
33 | architect
34 |
35 |
36 |
--------------------------------------------------------------------------------
/tck/lifecycle/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 | 4.0.0
20 |
21 |
22 | org.eclipse.ee4j.tck.authentication
23 | jakarta-authentication-tck
24 | 3.1.0-SNAPSHOT
25 |
26 |
27 | lifecycle
28 | war
29 |
30 | Jakarta Authentication TCK - lifecycle
31 |
32 |
33 |
34 | org.jakartaee
35 | jaspic-common
36 | 1.0-SNAPSHOT
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/tck/lifecycle/src/main/java/ee/jakarta/tck/authentication/test/lifecycle/sam/SamAutoRegistrationListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.lifecycle.sam;
17 |
18 | import jakarta.security.auth.message.config.AuthConfigFactory;
19 | import jakarta.servlet.ServletContextEvent;
20 | import jakarta.servlet.ServletContextListener;
21 | import jakarta.servlet.annotation.WebListener;
22 |
23 | /**
24 | *
25 | * @author Arjan Tijms
26 | *
27 | */
28 | @WebListener
29 | public class SamAutoRegistrationListener implements ServletContextListener {
30 |
31 | @Override
32 | public void contextInitialized(ServletContextEvent sce) {
33 | AuthConfigFactory.getFactory()
34 | .registerServerAuthModule(new TestLifecycleAuthModule(), sce.getServletContext());
35 | }
36 |
37 | }
--------------------------------------------------------------------------------
/tck/lifecycle/src/main/java/ee/jakarta/tck/authentication/test/lifecycle/servlet/ProtectedServlet.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.lifecycle.servlet;
17 |
18 | import java.io.IOException;
19 |
20 | import jakarta.servlet.ServletException;
21 | import jakarta.servlet.annotation.WebServlet;
22 | import jakarta.servlet.http.HttpServlet;
23 | import jakarta.servlet.http.HttpServletRequest;
24 | import jakarta.servlet.http.HttpServletResponse;
25 |
26 | /**
27 | *
28 | * @author Arjan Tijms
29 | *
30 | */
31 | @WebServlet(urlPatterns = "/protected/servlet")
32 | public class ProtectedServlet extends HttpServlet {
33 |
34 | private static final long serialVersionUID = 1L;
35 |
36 | @Override
37 | public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
38 | response.getWriter().write("Resource invoked\n");
39 |
40 | if (request.getParameter("doLogout") != null) {
41 | request.logout();
42 | }
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/tck/lifecycle/src/main/java/ee/jakarta/tck/authentication/test/lifecycle/servlet/PublicServlet.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.lifecycle.servlet;
17 |
18 | import java.io.IOException;
19 |
20 | import jakarta.servlet.ServletException;
21 | import jakarta.servlet.annotation.WebServlet;
22 | import jakarta.servlet.http.HttpServlet;
23 | import jakarta.servlet.http.HttpServletRequest;
24 | import jakarta.servlet.http.HttpServletResponse;
25 |
26 | /**
27 | *
28 | * @author Arjan Tijms
29 | *
30 | */
31 | @WebServlet(urlPatterns = "/public/servlet")
32 | public class PublicServlet extends HttpServlet {
33 |
34 | private static final long serialVersionUID = 1L;
35 |
36 | @Override
37 | public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
38 | response.getWriter().write("Public resource invoked\n");
39 |
40 | if (request.getParameter("doLogout") != null) {
41 | request.logout();
42 | }
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/tck/lifecycle/src/main/webapp/WEB-INF/web.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
21 |
22 |
23 |
24 | Test
25 | /protected/*
26 |
27 |
28 | architect
29 |
30 |
31 |
32 |
33 | architect
34 |
35 |
36 |
--------------------------------------------------------------------------------
/tck/programmatic-authentication/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 | 4.0.0
20 |
21 |
22 | org.eclipse.ee4j.tck.authentication
23 | jakarta-authentication-tck
24 | 3.1.0-SNAPSHOT
25 |
26 |
27 | programmatic-authentication
28 | war
29 |
30 | Jakarta Authentication TCK - programmatic-authentication
31 |
32 |
33 |
34 | org.jakartaee
35 | jaspic-common
36 | 1.0-SNAPSHOT
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/tck/programmatic-authentication/src/main/java/ee/jakarta/tck/authentication/test/programmaticauthentication/sam/SamAutoRegistrationListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.programmaticauthentication.sam;
17 |
18 | import jakarta.security.auth.message.config.AuthConfigFactory;
19 | import jakarta.servlet.ServletContextEvent;
20 | import jakarta.servlet.ServletContextListener;
21 | import jakarta.servlet.annotation.WebListener;
22 |
23 | /**
24 | *
25 | * @author Arjan Tijms
26 | *
27 | */
28 | @WebListener
29 | public class SamAutoRegistrationListener implements ServletContextListener {
30 |
31 | @Override
32 | public void contextInitialized(ServletContextEvent sce) {
33 | AuthConfigFactory.getFactory()
34 | .registerServerAuthModule(new TestServerAuthModule(), sce.getServletContext());
35 | }
36 |
37 | }
--------------------------------------------------------------------------------
/tck/programmatic-authentication/src/main/webapp/WEB-INF/web.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
21 |
22 |
23 |
24 | Test
25 | /protected/*
26 |
27 |
28 | architect
29 |
30 |
31 |
32 |
33 | architect
34 |
35 |
36 |
--------------------------------------------------------------------------------
/tck/register-session/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 | 4.0.0
20 |
21 |
22 | org.eclipse.ee4j.tck.authentication
23 | jakarta-authentication-tck
24 | 3.1.0-SNAPSHOT
25 |
26 |
27 | register-session
28 | war
29 |
30 | Jakarta Authentication TCK - register-session
31 |
32 |
33 |
34 | org.jakartaee
35 | jaspic-common
36 | 1.0-SNAPSHOT
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/tck/register-session/src/main/java/ee/jakarta/tck/authentication/test/registersession/sam/MyPrincipal.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.registersession.sam;
17 |
18 | import java.security.Principal;
19 |
20 | /**
21 | *
22 | * @author Arjan Tijms
23 | *
24 | */
25 | public class MyPrincipal implements Principal {
26 |
27 | private final String name;
28 |
29 | public MyPrincipal(String name) {
30 | this.name = name;
31 | }
32 |
33 | @Override
34 | public String getName() {
35 | return name;
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/tck/register-session/src/main/java/ee/jakarta/tck/authentication/test/registersession/sam/SamAutoRegistrationListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.registersession.sam;
17 |
18 | import jakarta.security.auth.message.config.AuthConfigFactory;
19 | import jakarta.servlet.ServletContextEvent;
20 | import jakarta.servlet.ServletContextListener;
21 | import jakarta.servlet.annotation.WebListener;
22 |
23 | /**
24 | *
25 | * @author Arjan Tijms
26 | *
27 | */
28 | @WebListener
29 | public class SamAutoRegistrationListener implements ServletContextListener {
30 |
31 | @Override
32 | public void contextInitialized(ServletContextEvent sce) {
33 | AuthConfigFactory.getFactory()
34 | .registerServerAuthModule(new TestServerAuthModule(), sce.getServletContext());
35 | }
36 |
37 | }
--------------------------------------------------------------------------------
/tck/register-session/src/main/java/ee/jakarta/tck/authentication/test/registersession/servlet/ProtectedServlet.java:
--------------------------------------------------------------------------------
1 | package ee.jakarta.tck.authentication.test.registersession.servlet;
2 |
3 | import java.io.IOException;
4 | import java.security.Principal;
5 |
6 | import ee.jakarta.tck.authentication.test.registersession.sam.MyPrincipal;
7 | import jakarta.servlet.ServletException;
8 | import jakarta.servlet.annotation.WebServlet;
9 | import jakarta.servlet.http.HttpServlet;
10 | import jakarta.servlet.http.HttpServletRequest;
11 | import jakarta.servlet.http.HttpServletResponse;
12 | import jakarta.servlet.http.HttpSession;
13 |
14 |
15 | /**
16 | *
17 | * @author Arjan Tijms
18 | *
19 | */
20 | @WebServlet(urlPatterns = "/protected/servlet")
21 | public class ProtectedServlet extends HttpServlet {
22 |
23 | private static final long serialVersionUID = 1L;
24 |
25 | @Override
26 | public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
27 |
28 | response.getWriter().write("This is a protected servlet \n");
29 |
30 | String webName = null;
31 | boolean isCustomPrincipal = false;
32 | if (request.getUserPrincipal() != null) {
33 | Principal principal = request.getUserPrincipal();
34 | isCustomPrincipal = principal instanceof MyPrincipal;
35 | webName = request.getUserPrincipal().getName();
36 | }
37 |
38 | boolean webHasRole = request.isUserInRole("architect");
39 |
40 | response.getWriter().write("isCustomPrincipal: " + isCustomPrincipal + "\n");
41 | response.getWriter().write("web username: " + webName + "\n");
42 | response.getWriter().write("web user has role \"architect\": " + webHasRole + "\n");
43 |
44 | HttpSession session = request.getSession(false);
45 | if (session != null) {
46 | response.getWriter().write("Session ID: " + session.getId());
47 | } else {
48 | response.getWriter().write("No session");
49 | }
50 |
51 | }
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/tck/register-session/src/main/java/ee/jakarta/tck/authentication/test/registersession/servlet/PublicServlet.java:
--------------------------------------------------------------------------------
1 | package ee.jakarta.tck.authentication.test.registersession.servlet;
2 |
3 | import java.io.IOException;
4 | import java.security.Principal;
5 |
6 | import ee.jakarta.tck.authentication.test.registersession.sam.MyPrincipal;
7 | import jakarta.servlet.ServletException;
8 | import jakarta.servlet.annotation.WebServlet;
9 | import jakarta.servlet.http.HttpServlet;
10 | import jakarta.servlet.http.HttpServletRequest;
11 | import jakarta.servlet.http.HttpServletResponse;
12 | import jakarta.servlet.http.HttpSession;
13 |
14 |
15 | /**
16 | *
17 | * @author Arjan Tijms
18 | *
19 | */
20 | @WebServlet(urlPatterns = "/public/servlet")
21 | public class PublicServlet extends HttpServlet {
22 |
23 | private static final long serialVersionUID = 1L;
24 |
25 | @Override
26 | public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
27 |
28 | response.getWriter().write("This is a public servlet \n");
29 |
30 | String webName = null;
31 | boolean isCustomPrincipal = false;
32 | if (request.getUserPrincipal() != null) {
33 | Principal principal = request.getUserPrincipal();
34 | isCustomPrincipal = principal instanceof MyPrincipal;
35 | webName = principal.getName();
36 | }
37 |
38 | boolean webHasRole = request.isUserInRole("architect");
39 |
40 | response.getWriter().write("isCustomPrincipal: " + isCustomPrincipal + "\n");
41 | response.getWriter().write("web username: " + webName + "\n");
42 | response.getWriter().write("web user has role \"architect\": " + webHasRole + "\n");
43 |
44 | HttpSession session = request.getSession(false);
45 | if (session != null) {
46 | response.getWriter().write("Session ID: " + session.getId());
47 | } else {
48 | response.getWriter().write("No session");
49 | }
50 |
51 | }
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/tck/register-session/src/main/webapp/WEB-INF/web.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
22 |
23 |
24 |
25 | Test
26 | /protected/*
27 |
28 |
29 | architect
30 |
31 |
32 |
33 |
34 | architect
35 |
36 |
37 |
--------------------------------------------------------------------------------
/tck/spi/common/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 | 4.0.0
20 |
21 |
22 | org.eclipse.ee4j.tck.authentication
23 | spi
24 | 3.1.0-SNAPSHOT
25 |
26 |
27 | spi.common
28 |
29 | Jakarta Authentication TCK - Profile SPI Common
30 |
31 | A lot of tests about the nitty gritty regarding the SPI per profile.
32 |
33 |
34 |
35 |
36 | org.jakartaee
37 | jaspic-common
38 | 1.0-SNAPSHOT
39 |
40 |
41 | jakarta.xml.ws
42 | jakarta.xml.ws-api
43 | 4.0.2
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/tck/spi/common/src/main/java/ee/jakarta/tck/authentication/test/basic/sam/module/servlet/TSResponseWrapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Contributors to Eclipse Foundation.
3 | * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved.
4 | *
5 | * This program and the accompanying materials are made available under the
6 | * terms of the Eclipse Public License v. 2.0, which is available at
7 | * http://www.eclipse.org/legal/epl-2.0.
8 | *
9 | * This Source Code may also be made available under the following Secondary
10 | * Licenses when the conditions for such availability set forth in the
11 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
12 | * version 2 with the GNU Classpath Exception, which is available at
13 | * https://www.gnu.org/software/classpath/license.html.
14 | *
15 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16 | */
17 |
18 | package ee.jakarta.tck.authentication.test.basic.sam.module.servlet;
19 |
20 | import ee.jakarta.tck.authentication.test.basic.servlet.JASPICData;
21 | import ee.jakarta.tck.authentication.test.common.logging.server.TSLogger;
22 | import jakarta.servlet.http.HttpServletResponse;
23 | import jakarta.servlet.http.HttpServletResponseWrapper;
24 | import java.util.logging.Level;
25 |
26 | public class TSResponseWrapper extends HttpServletResponseWrapper {
27 | private TSLogger logger = null;
28 |
29 | public TSResponseWrapper(HttpServletResponse response) {
30 | super(response);
31 | logger = TSLogger.getTSLogger(JASPICData.LOGGER_NAME);
32 | logMsg("TSResponseWrapper constructor called");
33 | }
34 |
35 | @Override
36 | public String getHeader(String name) {
37 |
38 | if ("isResponseWrapped".equals(name)) {
39 | return "true";
40 | }
41 |
42 | return super.getHeader(name);
43 | }
44 |
45 | public void logMsg(String str) {
46 | if (logger != null) {
47 | logger.log(Level.INFO, str);
48 | } else {
49 | System.out.println("*** TSLogger Not Initialized properly ***");
50 | System.out.println("*** TSSVLogMessage : ***" + str);
51 | }
52 | }
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/tck/spi/common/src/main/java/ee/jakarta/tck/authentication/test/basic/sam/util/CEFormatException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Contributors to Eclipse Foundation.
3 | * Copyright (c) 1995, 2018 Oracle and/or its affiliates. All rights reserved.
4 | *
5 | * This program and the accompanying materials are made available under the
6 | * terms of the Eclipse Public License v. 2.0, which is available at
7 | * http://www.eclipse.org/legal/epl-2.0.
8 | *
9 | * This Source Code may also be made available under the following Secondary
10 | * Licenses when the conditions for such availability set forth in the
11 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
12 | * version 2 with the GNU Classpath Exception, which is available at
13 | * https://www.gnu.org/software/classpath/license.html.
14 | *
15 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16 | */
17 | package ee.jakarta.tck.authentication.test.basic.sam.util;
18 |
19 | import java.io.IOException;
20 |
21 | public class CEFormatException extends IOException {
22 | private static final long serialVersionUID = 1L;
23 |
24 | public CEFormatException(String s) {
25 | super(s);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/tck/spi/common/src/main/java/ee/jakarta/tck/authentication/test/basic/sam/util/CEStreamExhausted.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Contributors to Eclipse Foundation.
3 | * Copyright (c) 1995, 2018 Oracle and/or its affiliates. All rights reserved.
4 | *
5 | * This program and the accompanying materials are made available under the
6 | * terms of the Eclipse Public License v. 2.0, which is available at
7 | * http://www.eclipse.org/legal/epl-2.0.
8 | *
9 | * This Source Code may also be made available under the following Secondary
10 | * Licenses when the conditions for such availability set forth in the
11 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
12 | * version 2 with the GNU Classpath Exception, which is available at
13 | * https://www.gnu.org/software/classpath/license.html.
14 | *
15 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16 | */
17 | package ee.jakarta.tck.authentication.test.basic.sam.util;
18 |
19 | import java.io.IOException;
20 |
21 | /** This exception is thrown when EOF is reached */
22 | public class CEStreamExhausted extends IOException {
23 |
24 | private static final long serialVersionUID = 1L;
25 | };
26 |
--------------------------------------------------------------------------------
/tck/spi/common/src/main/resources/META-INF/services/jakarta.servlet.ServletContainerInitializer:
--------------------------------------------------------------------------------
1 | ee.jakarta.tck.authentication.test.basic.servlet.AuthFactoryContainerInitializer
--------------------------------------------------------------------------------
/tck/spi/common/src/main/webapp/WEB-INF/web.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
21 | spi_servlet
22 |
23 |
24 | BASIC
25 | default
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/tck/spi/servlet/auth.conf:
--------------------------------------------------------------------------------
1 | reg-entry {
2 | con-entry {
3 | ee.jakarta.tck.authentication.test.basic.sam.config.TSAuthConfigProvider
4 | AuthStatus_SEND_SUCCESS:false
5 | requestPolicy:USER_NAME_PASSWORD
6 | }
7 | reg-ctx {
8 | layer:SOAP
9 | app-ctx:null
10 | description:TestSuite JSR 196 Config Provider
11 | }
12 | reg-ctx {
13 | layer:SOAP
14 | app-ctx:localhost /Hello_web/Hello
15 | description:TestSuite JSR 196 Config Provider
16 | }
17 | }
18 | reg-entry {
19 | con-entry {
20 | ee.jakarta.tck.authentication.test.basic.sam.TSAuthConfigProviderServlet
21 | AuthStatus_SEND_SUCCESS:true
22 | requestPolicy:USER_NAME_PASSWORD
23 | }
24 | reg-ctx {
25 | layer:HttpServlet
26 | app-ctx:server /spitests_servlet_web
27 | description:Registration for TSAuthConfigProviderServlet using spitests_servlet_web
28 | }
29 | reg-ctx {
30 | layer:HttpServlet
31 | app-ctx:server /spitests_servlet_web/WrapperServlet
32 | description:Registration for TSAuthConfigProviderServlet using spitests_servlet_web
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/tck/spi/servlet/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 | 4.0.0
20 |
21 |
22 | org.eclipse.ee4j.tck.authentication
23 | spi
24 | 3.1.0-SNAPSHOT
25 |
26 |
27 | spi.servlet
28 | war
29 |
30 | Jakarta Authentication TCK - Profile SPI Servlet
31 |
32 | A lot of tests about the nitty gritty regarding the SPI per profile.
33 |
34 |
35 |
36 |
37 | org.jakartaee
38 | jaspic-common
39 | 1.0-SNAPSHOT
40 |
41 |
42 | org.eclipse.ee4j.tck.authentication
43 | spi.common
44 | ${project.version}
45 |
46 |
47 |
48 |
49 | spitests_servlet_web
50 |
51 |
52 |
--------------------------------------------------------------------------------
/tck/spi/servlet/src/main/java/ee/jakarta/tck/authentication/test/basic/servlet/AuthFactoryContainerInitializer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Contributors to Eclipse Foundation.
3 | * Copyright (c) 2024 Contributors to the Eclipse Foundation
4 | *
5 | * This program and the accompanying materials are made available under the
6 | * terms of the Eclipse Public License v. 2.0, which is available at
7 | * http://www.eclipse.org/legal/epl-2.0.
8 | *
9 | * This Source Code may also be made available under the following Secondary
10 | * Licenses when the conditions for such availability set forth in the
11 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
12 | * version 2 with the GNU Classpath Exception, which is available at
13 | * https://www.gnu.org/software/classpath/license.html.
14 | *
15 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16 | */
17 | package ee.jakarta.tck.authentication.test.basic.servlet;
18 |
19 | import ee.jakarta.tck.authentication.test.basic.sam.config.TSAuthConfigFactory;
20 | import jakarta.security.auth.message.config.AuthConfigFactory;
21 | import jakarta.servlet.ServletContainerInitializer;
22 | import jakarta.servlet.ServletContext;
23 | import jakarta.servlet.ServletException;
24 | import java.util.Set;
25 |
26 | public class AuthFactoryContainerInitializer implements ServletContainerInitializer {
27 |
28 | @Override
29 | public void onStartup(Set> c, ServletContext ctx) throws ServletException {
30 | AuthConfigFactory.setFactory(new TSAuthConfigFactory());
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/tck/spi/servlet/src/main/resources/META-INF/services/jakarta.servlet.ServletContainerInitializer:
--------------------------------------------------------------------------------
1 | ee.jakarta.tck.authentication.test.basic.servlet.AuthFactoryContainerInitializer
--------------------------------------------------------------------------------
/tck/spi/servlet/src/main/webapp/WEB-INF/web.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
21 | spi_servlet
22 |
23 |
24 | BASIC
25 | default
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/tck/spi/soap/auth.conf:
--------------------------------------------------------------------------------
1 | reg-entry {
2 | con-entry {
3 | ee.jakarta.tck.authentication.test.basic.sam.config.TSAuthConfigProvider
4 | AuthStatus_SEND_SUCCESS:false
5 | requestPolicy:USER_NAME_PASSWORD
6 | }
7 | reg-ctx {
8 | layer:SOAP
9 | app-ctx:null
10 | description:TestSuite JSR 196 Config Provider
11 | }
12 | reg-ctx {
13 | layer:SOAP
14 | app-ctx:localhost /Hello_web/Hello
15 | description:TestSuite JSR 196 Config Provider
16 | }
17 | }
18 | reg-entry {
19 | con-entry {
20 | ee.jakarta.tck.authentication.test.basic.sam.TSAuthConfigProviderServlet
21 | AuthStatus_SEND_SUCCESS:true
22 | requestPolicy:USER_NAME_PASSWORD
23 | }
24 | reg-ctx {
25 | layer:HttpServlet
26 | app-ctx:server /spitests_servlet_web
27 | description:Registration for TSAuthConfigProviderServlet using spitests_servlet_web
28 | }
29 | reg-ctx {
30 | layer:HttpServlet
31 | app-ctx:server /spitests_servlet_web/WrapperServlet
32 | description:Registration for TSAuthConfigProviderServlet using spitests_servlet_web
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/tck/spi/soap/src/main/java/ee/jakarta/tck/authentication/test/basic/soap/AuthFactoryContainerInitializer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.basic.soap;
17 |
18 | import ee.jakarta.tck.authentication.test.basic.sam.config.TSAuthConfigFactory;
19 | import jakarta.security.auth.message.config.AuthConfigFactory;
20 | import jakarta.servlet.ServletContainerInitializer;
21 | import jakarta.servlet.ServletContext;
22 | import jakarta.servlet.ServletException;
23 | import java.util.Set;
24 |
25 | public class AuthFactoryContainerInitializer implements ServletContainerInitializer {
26 |
27 | @Override
28 | public void onStartup(Set> c, ServletContext ctx) throws ServletException {
29 | AuthConfigFactory.setFactory(new TSAuthConfigFactory());
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/tck/spi/soap/src/main/java/ee/jakarta/tck/authentication/test/basic/soap/Hello.java:
--------------------------------------------------------------------------------
1 |
2 | package ee.jakarta.tck.authentication.test.basic.soap;
3 |
4 | import jakarta.jws.WebMethod;
5 | import jakarta.jws.WebParam;
6 | import jakarta.jws.WebResult;
7 | import jakarta.jws.WebService;
8 | import jakarta.xml.bind.annotation.XmlSeeAlso;
9 | import jakarta.xml.ws.Action;
10 | import jakarta.xml.ws.RequestWrapper;
11 | import jakarta.xml.ws.ResponseWrapper;
12 |
13 |
14 | /**
15 | * This class was generated by the XML-WS Tools.
16 | * XML-WS Tools 4.0.1
17 | * Generated source version: 3.0
18 | *
19 | */
20 | @WebService(name = "Hello", targetNamespace = "http://soap.basic.test.authentication.tck.jakarta.ee/")
21 | @XmlSeeAlso({
22 | ObjectFactory.class
23 | })
24 | public interface Hello {
25 |
26 |
27 | /**
28 | *
29 | * @param arg0
30 | * @return
31 | * returns java.lang.String
32 | */
33 | @WebMethod
34 | @WebResult(targetNamespace = "")
35 | @RequestWrapper(localName = "sayHelloProtected", targetNamespace = "http://soap.basic.test.authentication.tck.jakarta.ee/", className = "ee.jakarta.tck.authentication.test.basic.soap.SayHelloProtected")
36 | @ResponseWrapper(localName = "sayHelloProtectedResponse", targetNamespace = "http://soap.basic.test.authentication.tck.jakarta.ee/", className = "ee.jakarta.tck.authentication.test.basic.soap.SayHelloProtectedResponse")
37 | @Action(input = "http://soap.basic.test.authentication.tck.jakarta.ee/Hello/sayHelloProtectedRequest", output = "http://soap.basic.test.authentication.tck.jakarta.ee/Hello/sayHelloProtectedResponse")
38 | public String sayHelloProtected(
39 | @WebParam(name = "arg0", targetNamespace = "")
40 | String arg0);
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/tck/spi/soap/src/main/java/ee/jakarta/tck/authentication/test/basic/soap/HelloImpl.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007, 2020 Oracle and/or its affiliates. All rights reserved.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 |
17 | package ee.jakarta.tck.authentication.test.basic.soap;
18 |
19 | import jakarta.jws.WebMethod;
20 | import jakarta.jws.WebService;
21 |
22 | @WebService(name = "Hello", serviceName = "HelloService")
23 | public class HelloImpl {
24 |
25 | @WebMethod
26 | public String sayHelloProtected(String param) {
27 | return "Hello " + param;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/tck/spi/soap/src/main/java/ee/jakarta/tck/authentication/test/basic/soap/SayHelloProtected.java:
--------------------------------------------------------------------------------
1 |
2 | package ee.jakarta.tck.authentication.test.basic.soap;
3 |
4 | import jakarta.xml.bind.annotation.XmlAccessType;
5 | import jakarta.xml.bind.annotation.XmlAccessorType;
6 | import jakarta.xml.bind.annotation.XmlType;
7 |
8 |
9 | /**
10 | *
Java class for sayHelloProtected complex type.
11 | *
12 | *
The following schema fragment specifies the expected content contained within this class.
13 | *
14 | *
26 | *
27 | *
28 | */
29 | @XmlAccessorType(XmlAccessType.FIELD)
30 | @XmlType(name = "sayHelloProtectedResponse", propOrder = {
31 | "_return"
32 | })
33 | public class SayHelloProtectedResponse {
34 |
35 | @XmlElement(name = "return")
36 | protected String _return;
37 |
38 | /**
39 | * Gets the value of the return property.
40 | *
41 | * @return
42 | * possible object is
43 | * {@link String }
44 | *
45 | */
46 | public String getReturn() {
47 | return _return;
48 | }
49 |
50 | /**
51 | * Sets the value of the return property.
52 | *
53 | * @param value
54 | * allowed object is
55 | * {@link String }
56 | *
57 | */
58 | public void setReturn(String value) {
59 | this._return = value;
60 | }
61 |
62 | }
63 |
--------------------------------------------------------------------------------
/tck/spi/soap/src/main/java/ee/jakarta/tck/authentication/test/basic/soap/package-info.java:
--------------------------------------------------------------------------------
1 | @jakarta.xml.bind.annotation.XmlSchema(namespace = "http://soap.basic.test.authentication.tck.jakarta.ee/")
2 | package ee.jakarta.tck.authentication.test.basic.soap;
3 |
--------------------------------------------------------------------------------
/tck/spi/soap/src/main/resources/META-INF/services/com.sun.xml.ws.assembler.metro.dev.ClientPipelineHook:
--------------------------------------------------------------------------------
1 | com.sun.enterprise.security.webservices.client.ClientSecurityPipeCreator
--------------------------------------------------------------------------------
/tck/spi/soap/src/main/resources/META-INF/services/jakarta.servlet.ServletContainerInitializer:
--------------------------------------------------------------------------------
1 | ee.jakarta.tck.authentication.test.basic.servlet.AuthFactoryContainerInitializer
--------------------------------------------------------------------------------
/tck/spi/soap/src/main/webapp/WEB-INF/HelloService_schema1.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/tck/spi/soap/src/main/webapp/WEB-INF/soap-web.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
24 |
25 | soap_app
26 |
27 |
28 | Hello
29 | ee.jakarta.tck.authentication.test.basic.soap.HelloImpl
30 | 0
31 |
32 | ADM
33 | Administrator
34 |
35 |
36 |
37 | Hello
38 | /Hello
39 |
40 |
41 |
42 | 54
43 |
44 |
45 |
46 | the administrator role
47 | Administrator
48 |
49 |
50 |
--------------------------------------------------------------------------------
/tck/spi/soap/src/main/webapp/WEB-INF/web.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
21 | spi_servlet
22 |
23 |
24 | BASIC
25 | default
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/tck/status-codes/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 | 4.0.0
20 |
21 |
22 | org.eclipse.ee4j.tck.authentication
23 | jakarta-authentication-tck
24 | 3.1.0-SNAPSHOT
25 |
26 |
27 | status-codes
28 | war
29 |
30 | Jakarta Authentication TCK - status-codes
31 |
32 |
33 |
34 | org.jakartaee
35 | jaspic-common
36 | 1.0-SNAPSHOT
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/tck/status-codes/src/main/java/ee/jakarta/tck/authentication/test/statuscodes/sam/SamAutoRegistrationListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.statuscodes.sam;
17 |
18 | import jakarta.security.auth.message.config.AuthConfigFactory;
19 | import jakarta.servlet.ServletContextEvent;
20 | import jakarta.servlet.ServletContextListener;
21 | import jakarta.servlet.annotation.WebListener;
22 |
23 | /**
24 | *
25 | * @author Arjan Tijms
26 | *
27 | */
28 | @WebListener
29 | public class SamAutoRegistrationListener implements ServletContextListener {
30 |
31 | @Override
32 | public void contextInitialized(ServletContextEvent sce) {
33 | AuthConfigFactory.getFactory()
34 | .registerServerAuthModule(new TestServerAuthModule(), sce.getServletContext());
35 | }
36 |
37 | }
--------------------------------------------------------------------------------
/tck/status-codes/src/main/java/ee/jakarta/tck/authentication/test/statuscodes/servlet/ProtectedServlet.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.statuscodes.servlet;
17 |
18 | import java.io.IOException;
19 |
20 | import jakarta.servlet.ServletException;
21 | import jakarta.servlet.annotation.WebServlet;
22 | import jakarta.servlet.http.HttpServlet;
23 | import jakarta.servlet.http.HttpServletRequest;
24 | import jakarta.servlet.http.HttpServletResponse;
25 |
26 | /**
27 | *
28 | * @author Arjan Tijms
29 | *
30 | */
31 | @WebServlet(urlPatterns = "/protected/servlet")
32 | public class ProtectedServlet extends HttpServlet {
33 |
34 | private static final long serialVersionUID = 1L;
35 |
36 | @Override
37 | public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
38 | response.getWriter().write("This is a protected servlet \n");
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/tck/status-codes/src/main/java/ee/jakarta/tck/authentication/test/statuscodes/servlet/PublicServlet.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.statuscodes.servlet;
17 |
18 | import java.io.IOException;
19 |
20 | import jakarta.servlet.ServletException;
21 | import jakarta.servlet.annotation.WebServlet;
22 | import jakarta.servlet.http.HttpServlet;
23 | import jakarta.servlet.http.HttpServletRequest;
24 | import jakarta.servlet.http.HttpServletResponse;
25 |
26 | /**
27 | *
28 | * @author Arjan Tijms
29 | *
30 | */
31 | @WebServlet(urlPatterns = "/public/servlet")
32 | public class PublicServlet extends HttpServlet {
33 |
34 | private static final long serialVersionUID = 1L;
35 |
36 | @Override
37 | public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
38 | response.getWriter().write("This is a public servlet \n");
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/tck/status-codes/src/main/webapp/WEB-INF/web.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
21 |
22 |
23 |
24 | Test
25 | /protected/*
26 |
27 |
28 | architect
29 |
30 |
31 |
32 |
33 | architect
34 |
35 |
36 |
--------------------------------------------------------------------------------
/tck/status-codes/src/test/java/ee/jakarta/tck/authentication/test/statuscodes/PublicStatusCodesTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.statuscodes;
17 |
18 | import static org.junit.Assert.assertEquals;
19 |
20 | import java.io.IOException;
21 |
22 | import org.jboss.arquillian.container.test.api.Deployment;
23 | import org.jboss.arquillian.junit.Arquillian;
24 | import org.jboss.shrinkwrap.api.Archive;
25 | import org.junit.Test;
26 | import org.junit.runner.RunWith;
27 |
28 | import ee.jakarta.tck.authentication.test.common.ArquillianBase;
29 |
30 |
31 | /**
32 | * This tests that a SAM can set a 404 response code when a public resource is requested.
33 | * Note the resource is not actual invoked, as the SAM returns SEND_FAILURE.
34 | *
35 | * @author Arjan Tijms
36 | *
37 | */
38 | @RunWith(Arquillian.class)
39 | public class PublicStatusCodesTest extends ArquillianBase {
40 |
41 | @Deployment(testable = false)
42 | public static Archive> createDeployment() {
43 | return defaultArchive();
44 | }
45 |
46 | @Test
47 | public void test404inResponse() throws IOException {
48 |
49 | int code = getWebClient().getPage(getBase() + "public/servlet")
50 | .getWebResponse()
51 | .getStatusCode();
52 |
53 | assertEquals(
54 | "Response should have 404 not found as status code, but did not.",
55 | 404, code
56 | );
57 | }
58 |
59 | }
--------------------------------------------------------------------------------
/tck/wrapping/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 | 4.0.0
20 |
21 |
22 | org.eclipse.ee4j.tck.authentication
23 | jakarta-authentication-tck
24 | 3.1.0-SNAPSHOT
25 |
26 |
27 | wrapping
28 | war
29 |
30 | Jakarta Authentication TCK - wrapping
31 |
32 |
33 |
34 | org.jakartaee
35 | jaspic-common
36 | 1.0-SNAPSHOT
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/tck/wrapping/src/main/java/ee/jakarta/tck/authentication/test/wrapping/sam/SamAutoRegistrationListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.wrapping.sam;
17 |
18 | import static java.util.EnumSet.allOf;
19 |
20 | import ee.jakarta.tck.authentication.test.wrapping.servlet.ProgrammaticFilter;
21 | import jakarta.security.auth.message.config.AuthConfigFactory;
22 | import jakarta.servlet.DispatcherType;
23 | import jakarta.servlet.ServletContextEvent;
24 | import jakarta.servlet.ServletContextListener;
25 | import jakarta.servlet.annotation.WebListener;
26 |
27 | /**
28 | *
29 | * @author Arjan Tijms
30 | *
31 | */
32 | @WebListener
33 | public class SamAutoRegistrationListener implements ServletContextListener {
34 |
35 | @Override
36 | public void contextInitialized(ServletContextEvent sce) {
37 | AuthConfigFactory.getFactory()
38 | .registerServerAuthModule(new TestWrappingServerAuthModule(), sce.getServletContext());
39 |
40 | sce.getServletContext()
41 | .addFilter("Programmatic filter", ProgrammaticFilter.class)
42 | .addMappingForUrlPatterns(allOf(DispatcherType.class), false, "/*");
43 | }
44 |
45 | }
--------------------------------------------------------------------------------
/tck/wrapping/src/main/java/ee/jakarta/tck/authentication/test/wrapping/servlet/ProtectedServlet.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.wrapping.servlet;
17 |
18 | import java.io.IOException;
19 | import java.io.Writer;
20 |
21 | import jakarta.servlet.ServletException;
22 | import jakarta.servlet.annotation.WebServlet;
23 | import jakarta.servlet.http.HttpServlet;
24 | import jakarta.servlet.http.HttpServletRequest;
25 | import jakarta.servlet.http.HttpServletResponse;
26 |
27 | /**
28 | * This Servlet tests that the request and response objects it receives are the ones marked as wrapped by the SAM that executed
29 | * before the Servlet was called.
30 | *
31 | * @author Arjan Tijms
32 | *
33 | */
34 | @WebServlet(urlPatterns = "/protected/servlet")
35 | public class ProtectedServlet extends HttpServlet {
36 |
37 | private static final long serialVersionUID = 1L;
38 |
39 | @Override
40 | public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
41 |
42 | Writer writer = response.getWriter();
43 |
44 | writer.write("servlet request isWrapped: " + request.getAttribute("isWrapped"));
45 | writer.write("\n");
46 | writer.write("servlet response isWrapped: " + response.getHeader("isWrapped"));
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/tck/wrapping/src/main/java/ee/jakarta/tck/authentication/test/wrapping/servlet/TestHttpServletRequestWrapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.wrapping.servlet;
17 |
18 | import jakarta.servlet.http.HttpServletRequest;
19 | import jakarta.servlet.http.HttpServletRequestWrapper;
20 |
21 | /**
22 | *
23 | * @author Arjan Tijms
24 | *
25 | */
26 | public class TestHttpServletRequestWrapper extends HttpServletRequestWrapper {
27 |
28 | public TestHttpServletRequestWrapper(HttpServletRequest request) {
29 | super(request);
30 | }
31 |
32 | @Override
33 | public Object getAttribute(String name) {
34 |
35 | if ("isWrapped".equals(name)) {
36 | return Boolean.TRUE;
37 | }
38 |
39 | return super.getAttribute(name);
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/tck/wrapping/src/main/java/ee/jakarta/tck/authentication/test/wrapping/servlet/TestHttpServletResponseWrapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022-2022 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | package ee.jakarta.tck.authentication.test.wrapping.servlet;
17 |
18 | import jakarta.servlet.http.HttpServletResponse;
19 | import jakarta.servlet.http.HttpServletResponseWrapper;
20 |
21 | /**
22 | *
23 | * @author Arjan Tijms
24 | *
25 | */
26 | public class TestHttpServletResponseWrapper extends HttpServletResponseWrapper {
27 |
28 | public TestHttpServletResponseWrapper(HttpServletResponse response) {
29 | super(response);
30 | }
31 |
32 | @Override
33 | public String getHeader(String name) {
34 |
35 | if ("isWrapped".equals(name)) {
36 | return "true";
37 | }
38 |
39 | return super.getHeader(name);
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/tck/wrapping/src/main/webapp/WEB-INF/web.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
21 |
22 |
23 |
24 | Test
25 | /protected/*
26 |
27 |
28 | architect
29 |
30 |
31 |
32 |
33 | architect
34 |
35 |
36 |
--------------------------------------------------------------------------------