diff --git a/openid-standalone-it/pom.xml b/openid-standalone-it/pom.xml index 7298eae4..3ac8ad3e 100644 --- a/openid-standalone-it/pom.xml +++ b/openid-standalone-it/pom.xml @@ -47,14 +47,14 @@ security-connectors-parent fish.payara.security.connectors - 2.4.0-SNAPSHOT + 3.0.Alpha6-SNAPSHOT 4.0.0 openid-standalone-it - 5.2022.2 + 6.2022.1.Alpha3 1.7.0.Alpha12 5.9.0 @@ -112,7 +112,7 @@ org.jboss.arquillian.protocol - arquillian-protocol-servlet + arquillian-protocol-servlet-jakarta test @@ -137,6 +137,11 @@ jersey-common provided + + org.glassfish.jersey.core + jersey-client + provided + diff --git a/openid-standalone-it/src/main/java/fish/payara/security/openid/idp/AbstractIdProvider.java b/openid-standalone-it/src/main/java/fish/payara/security/openid/idp/AbstractIdProvider.java index de8d62a2..c1f90396 100644 --- a/openid-standalone-it/src/main/java/fish/payara/security/openid/idp/AbstractIdProvider.java +++ b/openid-standalone-it/src/main/java/fish/payara/security/openid/idp/AbstractIdProvider.java @@ -47,24 +47,6 @@ import java.util.concurrent.ConcurrentMap; import java.util.logging.Logger; -import javax.json.Json; -import javax.json.JsonObject; -import javax.json.JsonObjectBuilder; -import javax.ws.rs.BeanParam; -import javax.ws.rs.Consumes; -import javax.ws.rs.FormParam; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriBuilder; -import javax.ws.rs.core.UriInfo; - import com.nimbusds.jose.JOSEException; import com.nimbusds.jose.JWSAlgorithm; import com.nimbusds.jose.JWSHeader; @@ -79,12 +61,29 @@ import com.nimbusds.jwt.JWT; import com.nimbusds.jwt.JWTClaimsSet; import com.nimbusds.jwt.SignedJWT; +import jakarta.json.Json; +import jakarta.json.JsonObject; +import jakarta.json.JsonObjectBuilder; +import jakarta.ws.rs.BeanParam; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.FormParam; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.HeaderParam; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.QueryParam; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.MultivaluedMap; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.UriBuilder; +import jakarta.ws.rs.core.UriInfo; import static fish.payara.security.connectors.openid.api.OpenIdConstant.*; +import static jakarta.ws.rs.core.MediaType.APPLICATION_FORM_URLENCODED; +import static jakarta.ws.rs.core.MediaType.APPLICATION_JSON; import static java.util.logging.Level.INFO; import static java.util.logging.Level.SEVERE; -import static javax.ws.rs.core.MediaType.APPLICATION_FORM_URLENCODED; -import static javax.ws.rs.core.MediaType.APPLICATION_JSON; /** * @author Gaurav Gupta diff --git a/openid-standalone-it/src/main/java/fish/payara/security/openid/idp/NaiveCookieManager.java b/openid-standalone-it/src/main/java/fish/payara/security/openid/idp/NaiveCookieManager.java index 800e111e..434a5db4 100644 --- a/openid-standalone-it/src/main/java/fish/payara/security/openid/idp/NaiveCookieManager.java +++ b/openid-standalone-it/src/main/java/fish/payara/security/openid/idp/NaiveCookieManager.java @@ -47,12 +47,12 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import javax.ws.rs.client.ClientRequestContext; -import javax.ws.rs.client.ClientRequestFilter; -import javax.ws.rs.client.ClientResponseContext; -import javax.ws.rs.client.ClientResponseFilter; -import javax.ws.rs.core.Cookie; -import javax.ws.rs.core.NewCookie; +import jakarta.ws.rs.client.ClientRequestContext; +import jakarta.ws.rs.client.ClientRequestFilter; +import jakarta.ws.rs.client.ClientResponseContext; +import jakarta.ws.rs.client.ClientResponseFilter; +import jakarta.ws.rs.core.Cookie; +import jakarta.ws.rs.core.NewCookie; public class NaiveCookieManager implements ClientRequestFilter, ClientResponseFilter { private static Map cookies = new ConcurrentHashMap<>(); diff --git a/openid-standalone-it/src/test/java/fish/payara/security/openid/adfs/AccessTokenRoleMapping.java b/openid-standalone-it/src/test/java/fish/payara/security/openid/adfs/AccessTokenRoleMapping.java index 020dac4e..259de3d3 100644 --- a/openid-standalone-it/src/test/java/fish/payara/security/openid/adfs/AccessTokenRoleMapping.java +++ b/openid-standalone-it/src/test/java/fish/payara/security/openid/adfs/AccessTokenRoleMapping.java @@ -45,10 +45,9 @@ import java.util.Collections; import java.util.Set; -import javax.enterprise.context.ApplicationScoped; - import fish.payara.security.connectors.openid.api.AccessTokenCallerPrincipal; import fish.payara.security.connectors.openid.api.BearerGroupsIdentityStore; +import jakarta.enterprise.context.ApplicationScoped; @ApplicationScoped public class AccessTokenRoleMapping extends BearerGroupsIdentityStore { diff --git a/openid-standalone-it/src/test/java/fish/payara/security/openid/adfs/AdfsAuth.java b/openid-standalone-it/src/test/java/fish/payara/security/openid/adfs/AdfsAuth.java index 6d18b5d9..5a5927c1 100644 --- a/openid-standalone-it/src/test/java/fish/payara/security/openid/adfs/AdfsAuth.java +++ b/openid-standalone-it/src/test/java/fish/payara/security/openid/adfs/AdfsAuth.java @@ -44,15 +44,14 @@ import java.security.Principal; -import javax.annotation.security.DeclareRoles; -import javax.annotation.security.RolesAllowed; -import javax.enterprise.context.RequestScoped; -import javax.inject.Inject; -import javax.ws.rs.GET; -import javax.ws.rs.Path; - import fish.payara.security.connectors.annotations.OpenIdAuthenticationDefinition; import fish.payara.security.connectors.annotations.OpenIdProviderMetadata; +import jakarta.annotation.security.DeclareRoles; +import jakarta.annotation.security.RolesAllowed; +import jakarta.enterprise.context.RequestScoped; +import jakarta.inject.Inject; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; @RequestScoped @OpenIdAuthenticationDefinition( diff --git a/openid-standalone-it/src/test/java/fish/payara/security/openid/adfs/AdfsEmulation.java b/openid-standalone-it/src/test/java/fish/payara/security/openid/adfs/AdfsEmulation.java index 9321feec..76cd07a0 100644 --- a/openid-standalone-it/src/test/java/fish/payara/security/openid/adfs/AdfsEmulation.java +++ b/openid-standalone-it/src/test/java/fish/payara/security/openid/adfs/AdfsEmulation.java @@ -46,12 +46,6 @@ import java.util.Arrays; import java.util.Date; -import javax.json.JsonObject; -import javax.json.JsonObjectBuilder; -import javax.ws.rs.NotAuthorizedException; -import javax.ws.rs.Path; -import javax.ws.rs.core.Response; - import com.nimbusds.jose.JOSEException; import com.nimbusds.jose.jwk.JWKSet; import com.nimbusds.jwt.JWT; @@ -59,6 +53,11 @@ import fish.payara.security.openid.idp.AbstractIdProvider; import fish.payara.security.openid.idp.AuthCode; import fish.payara.security.openid.idp.Token; +import jakarta.json.JsonObject; +import jakarta.json.JsonObjectBuilder; +import jakarta.ws.rs.NotAuthorizedException; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.core.Response; @Path("idp") public class AdfsEmulation extends AbstractIdProvider { diff --git a/openid-standalone-it/src/test/java/fish/payara/security/openid/adfs/AdfsEmulationIT.java b/openid-standalone-it/src/test/java/fish/payara/security/openid/adfs/AdfsEmulationIT.java index 5e816e4e..2cf9a35b 100644 --- a/openid-standalone-it/src/test/java/fish/payara/security/openid/adfs/AdfsEmulationIT.java +++ b/openid-standalone-it/src/test/java/fish/payara/security/openid/adfs/AdfsEmulationIT.java @@ -45,20 +45,19 @@ import java.io.IOException; import java.net.URI; -import javax.json.Json; -import javax.json.JsonArray; -import javax.json.JsonObject; -import javax.ws.rs.client.Client; -import javax.ws.rs.client.ClientBuilder; -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.WebTarget; -import javax.ws.rs.core.Form; -import javax.ws.rs.core.Response; - -import fish.payara.arquillian.jersey.client.ClientProperties; import fish.payara.security.openid.idp.LogExceptionOnServerSide; import fish.payara.security.openid.idp.NaiveCookieManager; import fish.payara.security.openid.idp.OpenIdDeployment; +import jakarta.json.Json; +import jakarta.json.JsonArray; +import jakarta.json.JsonObject; +import jakarta.ws.rs.client.Client; +import jakarta.ws.rs.client.ClientBuilder; +import jakarta.ws.rs.client.Entity; +import jakarta.ws.rs.client.WebTarget; +import jakarta.ws.rs.core.Form; +import jakarta.ws.rs.core.Response; +import org.glassfish.jersey.client.ClientProperties; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.arquillian.test.api.ArquillianResource; diff --git a/openid-standalone-it/src/test/java/fish/payara/security/openid/adfs/JaxrsApplication.java b/openid-standalone-it/src/test/java/fish/payara/security/openid/adfs/JaxrsApplication.java index 624ba752..5dba21d9 100644 --- a/openid-standalone-it/src/test/java/fish/payara/security/openid/adfs/JaxrsApplication.java +++ b/openid-standalone-it/src/test/java/fish/payara/security/openid/adfs/JaxrsApplication.java @@ -42,8 +42,8 @@ package fish.payara.security.openid.adfs; -import javax.ws.rs.ApplicationPath; -import javax.ws.rs.core.Application; +import jakarta.ws.rs.ApplicationPath; +import jakarta.ws.rs.core.Application; @ApplicationPath("") public class JaxrsApplication extends Application { diff --git a/openid-standalone-it/src/test/java/fish/payara/security/openid/adfs/OpenIdCallback.java b/openid-standalone-it/src/test/java/fish/payara/security/openid/adfs/OpenIdCallback.java index 9076988a..957e3ab3 100644 --- a/openid-standalone-it/src/test/java/fish/payara/security/openid/adfs/OpenIdCallback.java +++ b/openid-standalone-it/src/test/java/fish/payara/security/openid/adfs/OpenIdCallback.java @@ -45,17 +45,16 @@ import java.security.Principal; import java.util.logging.Logger; -import javax.enterprise.context.RequestScoped; -import javax.inject.Inject; -import javax.json.Json; -import javax.json.JsonArray; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; - import fish.payara.security.connectors.openid.api.OpenIdContext; +import jakarta.enterprise.context.RequestScoped; +import jakarta.inject.Inject; +import jakarta.json.Json; +import jakarta.json.JsonArray; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; -import static javax.ws.rs.core.MediaType.APPLICATION_JSON; +import static jakarta.ws.rs.core.MediaType.APPLICATION_JSON; @Path("Callback") @RequestScoped diff --git a/openid-standalone-it/src/test/java/fish/payara/security/openid/adfs/UrlExtractor.java b/openid-standalone-it/src/test/java/fish/payara/security/openid/adfs/UrlExtractor.java index 9a4a89cc..7fd2962a 100644 --- a/openid-standalone-it/src/test/java/fish/payara/security/openid/adfs/UrlExtractor.java +++ b/openid-standalone-it/src/test/java/fish/payara/security/openid/adfs/UrlExtractor.java @@ -42,9 +42,9 @@ package fish.payara.security.openid.adfs; -import javax.enterprise.inject.Model; -import javax.inject.Inject; -import javax.servlet.http.HttpServletRequest; +import jakarta.enterprise.inject.Model; +import jakarta.inject.Inject; +import jakarta.servlet.http.HttpServletRequest; @Model public class UrlExtractor { diff --git a/openid-standalone-it/src/test/java/fish/payara/security/openid/idp/simple/Callback.java b/openid-standalone-it/src/test/java/fish/payara/security/openid/idp/simple/Callback.java index 28dc8896..5506a2de 100644 --- a/openid-standalone-it/src/test/java/fish/payara/security/openid/idp/simple/Callback.java +++ b/openid-standalone-it/src/test/java/fish/payara/security/openid/idp/simple/Callback.java @@ -42,13 +42,12 @@ package fish.payara.security.openid.idp.simple; -import javax.enterprise.context.RequestScoped; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; - import fish.payara.security.connectors.openid.api.OpenIdConstant; +import jakarta.enterprise.context.RequestScoped; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.QueryParam; @Path("callback/") @RequestScoped diff --git a/openid-standalone-it/src/test/java/fish/payara/security/openid/idp/simple/JaxrsApplication.java b/openid-standalone-it/src/test/java/fish/payara/security/openid/idp/simple/JaxrsApplication.java index 4ada9480..2a3f7d8d 100644 --- a/openid-standalone-it/src/test/java/fish/payara/security/openid/idp/simple/JaxrsApplication.java +++ b/openid-standalone-it/src/test/java/fish/payara/security/openid/idp/simple/JaxrsApplication.java @@ -42,8 +42,8 @@ package fish.payara.security.openid.idp.simple; -import javax.ws.rs.ApplicationPath; -import javax.ws.rs.core.Application; +import jakarta.ws.rs.ApplicationPath; +import jakarta.ws.rs.core.Application; @ApplicationPath("") public class JaxrsApplication extends Application { diff --git a/openid-standalone-it/src/test/java/fish/payara/security/openid/idp/simple/SimpleIdProvider.java b/openid-standalone-it/src/test/java/fish/payara/security/openid/idp/simple/SimpleIdProvider.java index fe84804d..e5dfebc1 100644 --- a/openid-standalone-it/src/test/java/fish/payara/security/openid/idp/simple/SimpleIdProvider.java +++ b/openid-standalone-it/src/test/java/fish/payara/security/openid/idp/simple/SimpleIdProvider.java @@ -42,13 +42,6 @@ package fish.payara.security.openid.idp.simple; -import javax.enterprise.context.RequestScoped; -import javax.json.JsonObject; -import javax.json.JsonValue; -import javax.ws.rs.Path; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.UriInfo; - import com.nimbusds.jose.JOSEException; import com.nimbusds.jose.jwk.JWKSet; import com.nimbusds.jwt.JWT; @@ -56,6 +49,12 @@ import fish.payara.security.openid.idp.AbstractIdProvider; import fish.payara.security.openid.idp.AuthCode; import fish.payara.security.openid.idp.Token; +import jakarta.enterprise.context.RequestScoped; +import jakarta.json.JsonObject; +import jakarta.json.JsonValue; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.UriInfo; @Path("simple/") @RequestScoped diff --git a/openid-standalone-it/src/test/java/fish/payara/security/openid/idp/simple/SimpleIdProviderIT.java b/openid-standalone-it/src/test/java/fish/payara/security/openid/idp/simple/SimpleIdProviderIT.java index e2c4472c..1189abd2 100644 --- a/openid-standalone-it/src/test/java/fish/payara/security/openid/idp/simple/SimpleIdProviderIT.java +++ b/openid-standalone-it/src/test/java/fish/payara/security/openid/idp/simple/SimpleIdProviderIT.java @@ -49,14 +49,6 @@ import java.util.logging.Level; import java.util.logging.Logger; -import javax.json.JsonObject; -import javax.ws.rs.client.Client; -import javax.ws.rs.client.ClientBuilder; -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.WebTarget; -import javax.ws.rs.core.Form; -import javax.ws.rs.core.MediaType; - import com.nimbusds.jose.JOSEException; import com.nimbusds.jose.JWSHeader; import com.nimbusds.jose.crypto.RSASSAVerifier; @@ -67,6 +59,13 @@ import com.nimbusds.jwt.SignedJWT; import fish.payara.security.openid.idp.LogExceptionOnServerSide; import fish.payara.security.openid.idp.OpenIdDeployment; +import jakarta.json.JsonObject; +import jakarta.ws.rs.client.Client; +import jakarta.ws.rs.client.ClientBuilder; +import jakarta.ws.rs.client.Entity; +import jakarta.ws.rs.client.WebTarget; +import jakarta.ws.rs.core.Form; +import jakarta.ws.rs.core.MediaType; import org.glassfish.jersey.logging.LoggingFeature; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit5.ArquillianExtension; diff --git a/openid/src/main/java/fish/payara/security/openid/OpenIdAuthenticationMechanism.java b/openid/src/main/java/fish/payara/security/openid/OpenIdAuthenticationMechanism.java index c59c9acc..b5459fc3 100644 --- a/openid/src/main/java/fish/payara/security/openid/OpenIdAuthenticationMechanism.java +++ b/openid/src/main/java/fish/payara/security/openid/OpenIdAuthenticationMechanism.java @@ -37,6 +37,13 @@ */ package fish.payara.security.openid; +import java.io.IOException; +import java.io.Serializable; +import java.io.StringReader; +import java.util.Optional; +import java.util.logging.Level; +import java.util.logging.Logger; + import fish.payara.security.openid.api.AccessTokenCredential; import fish.payara.security.openid.api.OpenIdState; import fish.payara.security.openid.api.RefreshToken; @@ -53,9 +60,10 @@ import jakarta.enterprise.inject.Typed; import jakarta.inject.Inject; import jakarta.json.Json; -import jakarta.json.JsonNumber; import jakarta.json.JsonObject; import jakarta.json.JsonReader; +import jakarta.security.auth.callback.Callback; +import jakarta.security.auth.callback.UnsupportedCallbackException; import jakarta.security.auth.message.callback.CallerPrincipalCallback; import jakarta.security.enterprise.AuthenticationException; import jakarta.security.enterprise.AuthenticationStatus; @@ -69,26 +77,17 @@ import jakarta.ws.rs.core.Response; import jakarta.ws.rs.core.Response.Status; -import javax.security.auth.callback.Callback; -import javax.security.auth.callback.UnsupportedCallbackException; -import java.io.IOException; -import java.io.Serializable; -import java.io.StringReader; -import java.util.Optional; -import java.util.logging.Level; -import java.util.logging.Logger; - import static fish.payara.security.openid.OpenIdUtil.isEmpty; import static fish.payara.security.openid.api.OpenIdConstant.CODE; -import static jakarta.security.enterprise.AuthenticationStatus.*; -import static jakarta.security.enterprise.identitystore.CredentialValidationResult.INVALID_RESULT; -import static jakarta.security.enterprise.identitystore.CredentialValidationResult.NOT_VALIDATED_RESULT; import static fish.payara.security.openid.api.OpenIdConstant.ERROR_DESCRIPTION_PARAM; import static fish.payara.security.openid.api.OpenIdConstant.ERROR_PARAM; import static fish.payara.security.openid.api.OpenIdConstant.EXPIRES_IN; import static fish.payara.security.openid.api.OpenIdConstant.REFRESH_TOKEN; import static fish.payara.security.openid.api.OpenIdConstant.STATE; import static fish.payara.security.openid.api.OpenIdConstant.TOKEN_TYPE; +import static jakarta.security.enterprise.AuthenticationStatus.*; +import static jakarta.security.enterprise.identitystore.CredentialValidationResult.INVALID_RESULT; +import static jakarta.security.enterprise.identitystore.CredentialValidationResult.NOT_VALIDATED_RESULT; import static java.util.Objects.isNull; import static java.util.Objects.nonNull; import static java.util.logging.Level.INFO; diff --git a/openid/src/main/java/fish/payara/security/openid/domain/OpenIdConfiguration.java b/openid/src/main/java/fish/payara/security/openid/domain/OpenIdConfiguration.java index 8b14d105..eb12168d 100644 --- a/openid/src/main/java/fish/payara/security/openid/domain/OpenIdConfiguration.java +++ b/openid/src/main/java/fish/payara/security/openid/domain/OpenIdConfiguration.java @@ -41,9 +41,7 @@ import java.util.List; import java.util.Map; -import javax.servlet.http.HttpServletRequest; -import fish.payara.security.openid.controller.JWTValidator; -import java.util.List; +import jakarta.servlet.http.HttpServletRequest; /** * OpenId Connect client configuration diff --git a/pom.xml b/pom.xml index 5a79b7e4..6105c52d 100644 --- a/pom.xml +++ b/pom.xml @@ -359,6 +359,9 @@ staged-jakarta-releases https://jakarta.oss.sonatype.org/content/groups/staging/ + + true + diff --git a/security-connectors-api/src/main/java/fish/payara/security/annotations/ClaimsDefinition.java b/security-connectors-api/src/main/java/fish/payara/security/annotations/ClaimsDefinition.java index bd4d52b7..34ffcb69 100644 --- a/security-connectors-api/src/main/java/fish/payara/security/annotations/ClaimsDefinition.java +++ b/security-connectors-api/src/main/java/fish/payara/security/annotations/ClaimsDefinition.java @@ -37,9 +37,10 @@ */ package fish.payara.security.annotations; +import java.lang.annotation.Retention; + import fish.payara.security.openid.api.OpenIdConstant; -import java.lang.annotation.Retention; import static java.lang.annotation.RetentionPolicy.RUNTIME; /** @@ -59,7 +60,7 @@ /** * Maps the callerNameClaim's value to caller name value in - * javax.security.enterprise.identitystore.IdentityStore#validate + * jakarta.security.enterprise.identitystore.IdentityStore#validate * *

* To set this using Microprofile Config use @@ -78,7 +79,7 @@ /** * Maps the callerGroupsClaim's value to caller groups value in - * javax.security.enterprise.identitystore.IdentityStore#validate + * jakarta.security.enterprise.identitystore.IdentityStore#validate * *

* To set this using Microprofile Config use