From fdb9f6bf5fc43d54c9396dc4dd577b6c84ecdb9d Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <Jacek@jacekk.info>
Date: Wed, 12 Jul 2023 09:37:20 +0000
Subject: [PATCH] Update to Keycloak 22.0.0

---
 src/test/java/org/keycloak/protocol/cas/SamlResponseTest.java                                        |    2 
 .github/workflows/test.yml                                                                           |    2 
 src/main/java/org/keycloak/protocol/cas/representations/CASServiceResponseAuthenticationFailure.java |    8 +-
 .github/workflows/update-deps.yml                                                                    |    2 
 src/test/java/org/keycloak/protocol/cas/ContentTypeHelperTest.java                                   |    5 -
 pom.xml                                                                                              |    8 +-
 src/main/java/org/keycloak/protocol/cas/endpoints/LogoutEndpoint.java                                |   14 +---
 src/main/java/org/keycloak/protocol/cas/endpoints/AbstractValidateEndpoint.java                      |    6 +-
 src/main/java/org/keycloak/protocol/cas/representations/package-info.java                            |    6 +-
 src/main/java/org/keycloak/protocol/cas/utils/AttributesMapAdapter.java                              |   12 ++--
 src/main/java/org/keycloak/protocol/cas/representations/CASServiceResponse.java                      |    2 
 src/main/java/org/keycloak/protocol/cas/utils/LogoutHelper.java                                      |    7 -
 src/main/java/org/keycloak/protocol/cas/CASLoginProtocol.java                                        |    6 +-
 src/main/java/org/keycloak/protocol/cas/endpoints/AuthorizationEndpoint.java                         |    7 +-
 src/main/java/org/keycloak/protocol/cas/utils/ServiceResponseHelper.java                             |    6 +-
 src/main/java/org/keycloak/protocol/cas/CASLoginProtocolService.java                                 |    8 +-
 src/main/java/org/keycloak/protocol/cas/utils/CASValidationException.java                            |    5 -
 src/main/java/org/keycloak/protocol/cas/utils/ServiceResponseMarshaller.java                         |    6 +-
 src/main/java/org/keycloak/protocol/cas/representations/CASServiceResponseAuthenticationSuccess.java |    7 +
 src/main/java/org/keycloak/protocol/cas/endpoints/ServiceValidateEndpoint.java                       |    8 ++
 src/main/java/org/keycloak/protocol/cas/utils/ContentTypeHelper.java                                 |    5 -
 src/main/java/org/keycloak/protocol/cas/installation/KeycloakCASClientInstallation.java              |    6 +-
 src/test/java/org/keycloak/protocol/cas/XMLValidator.java                                            |    2 
 src/main/java/org/keycloak/protocol/cas/endpoints/SamlValidateEndpoint.java                          |   15 +++--
 .github/workflows/release.yml                                                                        |    2 
 src/main/java/org/keycloak/protocol/cas/endpoints/ValidateEndpoint.java                              |    9 +-
 26 files changed, 83 insertions(+), 83 deletions(-)

diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 6bd93ac..8163160 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -21,7 +21,7 @@
         uses: actions/setup-java@v3
         with:
           distribution: zulu
-          java-version: 11
+          java-version: 17
 
       - id: vars
         name: Get project variables
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 3f51b24..ec0a3c9 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -19,7 +19,7 @@
         uses: actions/setup-java@v3
         with:
           distribution: zulu
-          java-version: 11
+          java-version: 17
 
       - id: vars
         name: Get project variables
diff --git a/.github/workflows/update-deps.yml b/.github/workflows/update-deps.yml
index 1394bf8..f0e05a0 100644
--- a/.github/workflows/update-deps.yml
+++ b/.github/workflows/update-deps.yml
@@ -24,7 +24,7 @@
         uses: actions/setup-java@v3
         with:
           distribution: zulu
-          java-version: 11
+          java-version: 17
 
       - id: update_keycloak
         name: Update Keycloak
diff --git a/pom.xml b/pom.xml
index 3edcdac..df17dc6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,21 +22,21 @@
 
     <groupId>org.keycloak</groupId>
     <artifactId>keycloak-protocol-cas</artifactId>
-    <version>21.1.2</version>
+    <version>22.0.0</version>
     <name>Keycloak CAS Protocol</name>
     <description />
 
     <properties>
         <keycloak.version>${project.version}</keycloak.version>
-        <apache.httpcomponents.version>4.5.13</apache.httpcomponents.version>
-        <jboss.logging.version>3.4.1.Final</jboss.logging.version>
+        <apache.httpcomponents.version>4.5.14</apache.httpcomponents.version>
+        <jboss.logging.version>3.5.1.Final</jboss.logging.version>
         <jboss.logging.tools.version>2.2.1.Final</jboss.logging.tools.version>
         <junit.version>4.13.2</junit.version>
 
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <maven.compiler.target>1.8</maven.compiler.target>
         <maven.compiler.source>1.8</maven.compiler.source>
-        <project.build.outputTimestamp>1687949811</project.build.outputTimestamp>
+        <project.build.outputTimestamp>1689151642</project.build.outputTimestamp>
     </properties>
 
     <dependencies>
diff --git a/src/main/java/org/keycloak/protocol/cas/CASLoginProtocol.java b/src/main/java/org/keycloak/protocol/cas/CASLoginProtocol.java
index 0317f0d..5c47e9d 100644
--- a/src/main/java/org/keycloak/protocol/cas/CASLoginProtocol.java
+++ b/src/main/java/org/keycloak/protocol/cas/CASLoginProtocol.java
@@ -1,5 +1,8 @@
 package org.keycloak.protocol.cas;
 
+import jakarta.ws.rs.core.HttpHeaders;
+import jakarta.ws.rs.core.Response;
+import jakarta.ws.rs.core.UriInfo;
 import org.apache.http.HttpEntity;
 import org.jboss.logging.Logger;
 import org.keycloak.common.util.KeycloakUriBuilder;
@@ -17,9 +20,6 @@
 import org.keycloak.services.managers.ResourceAdminManager;
 import org.keycloak.sessions.AuthenticationSessionModel;
 
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriInfo;
 import java.io.IOException;
 import java.net.URI;
 import java.util.UUID;
diff --git a/src/main/java/org/keycloak/protocol/cas/CASLoginProtocolService.java b/src/main/java/org/keycloak/protocol/cas/CASLoginProtocolService.java
index 041303e..e8cbb39 100644
--- a/src/main/java/org/keycloak/protocol/cas/CASLoginProtocolService.java
+++ b/src/main/java/org/keycloak/protocol/cas/CASLoginProtocolService.java
@@ -1,5 +1,10 @@
 package org.keycloak.protocol.cas;
 
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.core.Context;
+import jakarta.ws.rs.core.HttpHeaders;
+import jakarta.ws.rs.core.Response;
+import jakarta.ws.rs.core.UriBuilder;
 import org.jboss.resteasy.spi.HttpRequest;
 import org.jboss.resteasy.spi.ResteasyProviderFactory;
 import org.keycloak.events.EventBuilder;
@@ -7,9 +12,6 @@
 import org.keycloak.models.RealmModel;
 import org.keycloak.protocol.cas.endpoints.*;
 import org.keycloak.services.resources.RealmsResource;
-
-import javax.ws.rs.Path;
-import javax.ws.rs.core.*;
 
 public class CASLoginProtocolService {
     private KeycloakSession session;
diff --git a/src/main/java/org/keycloak/protocol/cas/endpoints/AbstractValidateEndpoint.java b/src/main/java/org/keycloak/protocol/cas/endpoints/AbstractValidateEndpoint.java
index e60b4e7..0b965d9 100644
--- a/src/main/java/org/keycloak/protocol/cas/endpoints/AbstractValidateEndpoint.java
+++ b/src/main/java/org/keycloak/protocol/cas/endpoints/AbstractValidateEndpoint.java
@@ -1,5 +1,8 @@
 package org.keycloak.protocol.cas.endpoints;
 
+import jakarta.ws.rs.core.Context;
+import jakarta.ws.rs.core.HttpHeaders;
+import jakarta.ws.rs.core.Response;
 import org.jboss.logging.Logger;
 import org.jboss.resteasy.spi.HttpRequest;
 import org.keycloak.common.ClientConnection;
@@ -17,9 +20,6 @@
 import org.keycloak.services.managers.AuthenticationManager;
 import org.keycloak.services.util.DefaultClientSessionContext;
 
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.Response;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
diff --git a/src/main/java/org/keycloak/protocol/cas/endpoints/AuthorizationEndpoint.java b/src/main/java/org/keycloak/protocol/cas/endpoints/AuthorizationEndpoint.java
index 103249f..1dc2eef 100644
--- a/src/main/java/org/keycloak/protocol/cas/endpoints/AuthorizationEndpoint.java
+++ b/src/main/java/org/keycloak/protocol/cas/endpoints/AuthorizationEndpoint.java
@@ -1,5 +1,8 @@
 package org.keycloak.protocol.cas.endpoints;
 
+import jakarta.ws.rs.GET;
+import jakarta.ws.rs.core.MultivaluedMap;
+import jakarta.ws.rs.core.Response;
 import org.jboss.logging.Logger;
 import org.keycloak.events.Details;
 import org.keycloak.events.Errors;
@@ -14,10 +17,6 @@
 import org.keycloak.services.messages.Messages;
 import org.keycloak.services.util.CacheControlUtil;
 import org.keycloak.sessions.AuthenticationSessionModel;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.Response;
 
 public class AuthorizationEndpoint extends AuthorizationEndpointBase {
     private static final Logger logger = Logger.getLogger(AuthorizationEndpoint.class);
diff --git a/src/main/java/org/keycloak/protocol/cas/endpoints/LogoutEndpoint.java b/src/main/java/org/keycloak/protocol/cas/endpoints/LogoutEndpoint.java
index bf65e22..bd3a48a 100644
--- a/src/main/java/org/keycloak/protocol/cas/endpoints/LogoutEndpoint.java
+++ b/src/main/java/org/keycloak/protocol/cas/endpoints/LogoutEndpoint.java
@@ -1,13 +1,14 @@
 package org.keycloak.protocol.cas.endpoints;
 
+import jakarta.ws.rs.GET;
+import jakarta.ws.rs.QueryParam;
+import jakarta.ws.rs.core.Context;
+import jakarta.ws.rs.core.HttpHeaders;
+import jakarta.ws.rs.core.Response;
 import org.jboss.logging.Logger;
 import org.jboss.resteasy.annotations.cache.NoCache;
 import org.jboss.resteasy.spi.HttpRequest;
 import org.keycloak.common.ClientConnection;
-import org.keycloak.events.Details;
-import org.keycloak.events.Errors;
-import org.keycloak.events.EventBuilder;
-import org.keycloak.events.EventType;
 import org.keycloak.models.ClientModel;
 import org.keycloak.models.KeycloakSession;
 import org.keycloak.models.RealmModel;
@@ -18,11 +19,6 @@
 import org.keycloak.services.managers.AuthenticationManager;
 import org.keycloak.services.messages.Messages;
 
-import javax.ws.rs.GET;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.Response;
 import java.net.URI;
 
 public class LogoutEndpoint {
diff --git a/src/main/java/org/keycloak/protocol/cas/endpoints/SamlValidateEndpoint.java b/src/main/java/org/keycloak/protocol/cas/endpoints/SamlValidateEndpoint.java
index 74730ee..752153a 100644
--- a/src/main/java/org/keycloak/protocol/cas/endpoints/SamlValidateEndpoint.java
+++ b/src/main/java/org/keycloak/protocol/cas/endpoints/SamlValidateEndpoint.java
@@ -1,5 +1,10 @@
 package org.keycloak.protocol.cas.endpoints;
 
+import jakarta.ws.rs.Consumes;
+import jakarta.ws.rs.POST;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.core.MultivaluedMap;
+import jakarta.ws.rs.core.Response;
 import org.keycloak.dom.saml.v1.protocol.SAML11ResponseType;
 import org.keycloak.events.EventBuilder;
 import org.keycloak.events.EventType;
@@ -12,18 +17,16 @@
 import org.keycloak.services.Urls;
 import org.xml.sax.InputSource;
 
-import javax.ws.rs.Consumes;
-import javax.ws.rs.POST;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.Response;
 import javax.xml.namespace.NamespaceContext;
 import javax.xml.xpath.XPath;
 import javax.xml.xpath.XPathExpression;
 import javax.xml.xpath.XPathExpressionException;
 import javax.xml.xpath.XPathFactory;
 import java.io.StringReader;
-import java.util.*;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Optional;
 
 import static org.keycloak.protocol.cas.CASLoginProtocol.TARGET_PARAM;
 
diff --git a/src/main/java/org/keycloak/protocol/cas/endpoints/ServiceValidateEndpoint.java b/src/main/java/org/keycloak/protocol/cas/endpoints/ServiceValidateEndpoint.java
index 10a86c4..3d04ef1 100644
--- a/src/main/java/org/keycloak/protocol/cas/endpoints/ServiceValidateEndpoint.java
+++ b/src/main/java/org/keycloak/protocol/cas/endpoints/ServiceValidateEndpoint.java
@@ -1,13 +1,17 @@
 package org.keycloak.protocol.cas.endpoints;
 
+import jakarta.ws.rs.core.Context;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.Request;
+import jakarta.ws.rs.core.Response;
 import org.keycloak.events.EventBuilder;
-import org.keycloak.models.*;
+import org.keycloak.models.RealmModel;
+import org.keycloak.models.UserSessionModel;
 import org.keycloak.protocol.cas.representations.CASServiceResponse;
 import org.keycloak.protocol.cas.utils.CASValidationException;
 import org.keycloak.protocol.cas.utils.ContentTypeHelper;
 import org.keycloak.protocol.cas.utils.ServiceResponseHelper;
 
-import javax.ws.rs.core.*;
 import java.util.Map;
 
 public class ServiceValidateEndpoint extends ValidateEndpoint {
diff --git a/src/main/java/org/keycloak/protocol/cas/endpoints/ValidateEndpoint.java b/src/main/java/org/keycloak/protocol/cas/endpoints/ValidateEndpoint.java
index 157142f..810dcab 100644
--- a/src/main/java/org/keycloak/protocol/cas/endpoints/ValidateEndpoint.java
+++ b/src/main/java/org/keycloak/protocol/cas/endpoints/ValidateEndpoint.java
@@ -1,16 +1,15 @@
 package org.keycloak.protocol.cas.endpoints;
 
+import jakarta.ws.rs.GET;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.MultivaluedMap;
+import jakarta.ws.rs.core.Response;
 import org.jboss.resteasy.annotations.cache.NoCache;
 import org.keycloak.events.EventBuilder;
 import org.keycloak.events.EventType;
 import org.keycloak.models.RealmModel;
 import org.keycloak.protocol.cas.CASLoginProtocol;
 import org.keycloak.protocol.cas.utils.CASValidationException;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.Response;
 
 public class ValidateEndpoint extends AbstractValidateEndpoint {
 
diff --git a/src/main/java/org/keycloak/protocol/cas/installation/KeycloakCASClientInstallation.java b/src/main/java/org/keycloak/protocol/cas/installation/KeycloakCASClientInstallation.java
index 19473fa..1a99abf 100644
--- a/src/main/java/org/keycloak/protocol/cas/installation/KeycloakCASClientInstallation.java
+++ b/src/main/java/org/keycloak/protocol/cas/installation/KeycloakCASClientInstallation.java
@@ -1,5 +1,8 @@
 package org.keycloak.protocol.cas.installation;
 
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.Response;
+import jakarta.ws.rs.core.UriBuilder;
 import org.keycloak.Config;
 import org.keycloak.models.ClientModel;
 import org.keycloak.models.KeycloakSession;
@@ -9,9 +12,6 @@
 import org.keycloak.protocol.cas.CASLoginProtocol;
 import org.keycloak.services.resources.RealmsResource;
 
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriBuilder;
 import java.net.URI;
 
 public class KeycloakCASClientInstallation implements ClientInstallationProvider {
diff --git a/src/main/java/org/keycloak/protocol/cas/representations/CASServiceResponse.java b/src/main/java/org/keycloak/protocol/cas/representations/CASServiceResponse.java
index 42c8297..6716322 100644
--- a/src/main/java/org/keycloak/protocol/cas/representations/CASServiceResponse.java
+++ b/src/main/java/org/keycloak/protocol/cas/representations/CASServiceResponse.java
@@ -1,6 +1,6 @@
 package org.keycloak.protocol.cas.representations;
 
-import javax.xml.bind.annotation.XmlRootElement;
+import jakarta.xml.bind.annotation.XmlRootElement;
 
 @XmlRootElement(name = "serviceResponse")
 public class CASServiceResponse {
diff --git a/src/main/java/org/keycloak/protocol/cas/representations/CASServiceResponseAuthenticationFailure.java b/src/main/java/org/keycloak/protocol/cas/representations/CASServiceResponseAuthenticationFailure.java
index f0fbba5..b1a58f1 100644
--- a/src/main/java/org/keycloak/protocol/cas/representations/CASServiceResponseAuthenticationFailure.java
+++ b/src/main/java/org/keycloak/protocol/cas/representations/CASServiceResponseAuthenticationFailure.java
@@ -1,9 +1,9 @@
 package org.keycloak.protocol.cas.representations;
 
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlValue;
+import jakarta.xml.bind.annotation.XmlAccessType;
+import jakarta.xml.bind.annotation.XmlAccessorType;
+import jakarta.xml.bind.annotation.XmlAttribute;
+import jakarta.xml.bind.annotation.XmlValue;
 
 @XmlAccessorType(XmlAccessType.FIELD)
 public class CASServiceResponseAuthenticationFailure {
diff --git a/src/main/java/org/keycloak/protocol/cas/representations/CASServiceResponseAuthenticationSuccess.java b/src/main/java/org/keycloak/protocol/cas/representations/CASServiceResponseAuthenticationSuccess.java
index 3ef7754..94d34b1 100644
--- a/src/main/java/org/keycloak/protocol/cas/representations/CASServiceResponseAuthenticationSuccess.java
+++ b/src/main/java/org/keycloak/protocol/cas/representations/CASServiceResponseAuthenticationSuccess.java
@@ -1,9 +1,12 @@
 package org.keycloak.protocol.cas.representations;
 
+import jakarta.xml.bind.annotation.XmlAccessType;
+import jakarta.xml.bind.annotation.XmlAccessorType;
+import jakarta.xml.bind.annotation.XmlElement;
+import jakarta.xml.bind.annotation.XmlElementWrapper;
+import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 import org.keycloak.protocol.cas.utils.AttributesMapAdapter;
 
-import javax.xml.bind.annotation.*;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 import java.util.List;
 import java.util.Map;
 
diff --git a/src/main/java/org/keycloak/protocol/cas/representations/package-info.java b/src/main/java/org/keycloak/protocol/cas/representations/package-info.java
index 77a3ed5..a8ade6a 100644
--- a/src/main/java/org/keycloak/protocol/cas/representations/package-info.java
+++ b/src/main/java/org/keycloak/protocol/cas/representations/package-info.java
@@ -3,8 +3,8 @@
         xmlns = {
                 @XmlNs(namespaceURI = "http://www.yale.edu/tp/cas", prefix = "cas")
         },
-        elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+        elementFormDefault = jakarta.xml.bind.annotation.XmlNsForm.QUALIFIED)
 package org.keycloak.protocol.cas.representations;
 
-import javax.xml.bind.annotation.XmlNs;
-import javax.xml.bind.annotation.XmlSchema;
\ No newline at end of file
+import jakarta.xml.bind.annotation.XmlNs;
+import jakarta.xml.bind.annotation.XmlSchema;
diff --git a/src/main/java/org/keycloak/protocol/cas/utils/AttributesMapAdapter.java b/src/main/java/org/keycloak/protocol/cas/utils/AttributesMapAdapter.java
index 8afc07b..3da76a9 100644
--- a/src/main/java/org/keycloak/protocol/cas/utils/AttributesMapAdapter.java
+++ b/src/main/java/org/keycloak/protocol/cas/utils/AttributesMapAdapter.java
@@ -1,13 +1,13 @@
 package org.keycloak.protocol.cas.utils;
 
+import jakarta.xml.bind.JAXBElement;
+import jakarta.xml.bind.annotation.XmlAccessType;
+import jakarta.xml.bind.annotation.XmlAccessorType;
+import jakarta.xml.bind.annotation.XmlAnyElement;
+import jakarta.xml.bind.annotation.XmlSchema;
+import jakarta.xml.bind.annotation.adapters.XmlAdapter;
 import org.keycloak.protocol.cas.representations.CASServiceResponse;
 
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAnyElement;
-import javax.xml.bind.annotation.XmlSchema;
-import javax.xml.bind.annotation.adapters.XmlAdapter;
 import javax.xml.namespace.QName;
 import java.util.ArrayList;
 import java.util.Collection;
diff --git a/src/main/java/org/keycloak/protocol/cas/utils/CASValidationException.java b/src/main/java/org/keycloak/protocol/cas/utils/CASValidationException.java
index 31d786e..60da5f1 100644
--- a/src/main/java/org/keycloak/protocol/cas/utils/CASValidationException.java
+++ b/src/main/java/org/keycloak/protocol/cas/utils/CASValidationException.java
@@ -1,9 +1,8 @@
 package org.keycloak.protocol.cas.utils;
 
+import jakarta.ws.rs.WebApplicationException;
+import jakarta.ws.rs.core.Response;
 import org.keycloak.protocol.cas.representations.CASErrorCode;
-
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Response;
 
 public class CASValidationException extends WebApplicationException {
     private final CASErrorCode error;
diff --git a/src/main/java/org/keycloak/protocol/cas/utils/ContentTypeHelper.java b/src/main/java/org/keycloak/protocol/cas/utils/ContentTypeHelper.java
index b5ad8a5..789c8f9 100644
--- a/src/main/java/org/keycloak/protocol/cas/utils/ContentTypeHelper.java
+++ b/src/main/java/org/keycloak/protocol/cas/utils/ContentTypeHelper.java
@@ -1,10 +1,9 @@
 package org.keycloak.protocol.cas.utils;
 
+import jakarta.ws.rs.BadRequestException;
+import jakarta.ws.rs.core.*;
 import org.jboss.resteasy.spi.HttpRequest;
 import org.keycloak.protocol.cas.CASLoginProtocol;
-
-import javax.ws.rs.BadRequestException;
-import javax.ws.rs.core.*;
 
 public class ContentTypeHelper {
     private final HttpRequest request;
diff --git a/src/main/java/org/keycloak/protocol/cas/utils/LogoutHelper.java b/src/main/java/org/keycloak/protocol/cas/utils/LogoutHelper.java
index 5e26e8d..a807f02 100644
--- a/src/main/java/org/keycloak/protocol/cas/utils/LogoutHelper.java
+++ b/src/main/java/org/keycloak/protocol/cas/utils/LogoutHelper.java
@@ -1,5 +1,6 @@
 package org.keycloak.protocol.cas.utils;
 
+import jakarta.ws.rs.core.HttpHeaders;
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpResponse;
 import org.apache.http.NameValuePair;
@@ -7,20 +8,16 @@
 import org.apache.http.client.entity.UrlEncodedFormEntity;
 import org.apache.http.client.methods.HttpPost;
 import org.apache.http.message.BasicNameValuePair;
-import org.apache.http.entity.ContentType;
-import org.apache.http.entity.StringEntity;
 import org.keycloak.connections.httpclient.HttpClientProvider;
 import org.keycloak.models.KeycloakSession;
 
-import javax.ws.rs.core.HttpHeaders;
 import java.io.IOException;
 import java.io.InputStream;
-import java.nio.charset.StandardCharsets;
 import java.text.SimpleDateFormat;
 import java.util.Date;
-import java.util.UUID;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.UUID;
 
 public class LogoutHelper {
     //although it looks alike, the CAS SLO protocol has nothing to do with SAML; so we build the format
diff --git a/src/main/java/org/keycloak/protocol/cas/utils/ServiceResponseHelper.java b/src/main/java/org/keycloak/protocol/cas/utils/ServiceResponseHelper.java
index e3223d1..ada4d7f 100644
--- a/src/main/java/org/keycloak/protocol/cas/utils/ServiceResponseHelper.java
+++ b/src/main/java/org/keycloak/protocol/cas/utils/ServiceResponseHelper.java
@@ -1,13 +1,13 @@
 package org.keycloak.protocol.cas.utils;
 
+import jakarta.ws.rs.core.HttpHeaders;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.Response;
 import org.keycloak.protocol.cas.representations.CASErrorCode;
 import org.keycloak.protocol.cas.representations.CASServiceResponse;
 import org.keycloak.protocol.cas.representations.CASServiceResponseAuthenticationFailure;
 import org.keycloak.protocol.cas.representations.CASServiceResponseAuthenticationSuccess;
 
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
 import java.util.List;
 import java.util.Map;
 
diff --git a/src/main/java/org/keycloak/protocol/cas/utils/ServiceResponseMarshaller.java b/src/main/java/org/keycloak/protocol/cas/utils/ServiceResponseMarshaller.java
index d1b9d58..cb872ef 100644
--- a/src/main/java/org/keycloak/protocol/cas/utils/ServiceResponseMarshaller.java
+++ b/src/main/java/org/keycloak/protocol/cas/utils/ServiceResponseMarshaller.java
@@ -5,11 +5,11 @@
 import com.fasterxml.jackson.core.util.DefaultIndenter;
 import com.fasterxml.jackson.core.util.DefaultPrettyPrinter;
 import com.fasterxml.jackson.databind.ObjectMapper;
+import jakarta.xml.bind.JAXBContext;
+import jakarta.xml.bind.JAXBException;
+import jakarta.xml.bind.Marshaller;
 import org.keycloak.protocol.cas.representations.CASServiceResponse;
 
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
 import java.io.StringWriter;
 import java.nio.charset.StandardCharsets;
 import java.util.HashMap;
diff --git a/src/test/java/org/keycloak/protocol/cas/ContentTypeHelperTest.java b/src/test/java/org/keycloak/protocol/cas/ContentTypeHelperTest.java
index 11b7b4f..9bca8b9 100644
--- a/src/test/java/org/keycloak/protocol/cas/ContentTypeHelperTest.java
+++ b/src/test/java/org/keycloak/protocol/cas/ContentTypeHelperTest.java
@@ -1,13 +1,12 @@
 package org.keycloak.protocol.cas;
 
+import jakarta.ws.rs.core.HttpHeaders;
+import jakarta.ws.rs.core.MediaType;
 import org.jboss.resteasy.mock.MockHttpRequest;
 import org.jboss.resteasy.mock.MockHttpResponse;
 import org.jboss.resteasy.specimpl.RequestImpl;
 import org.junit.Test;
 import org.keycloak.protocol.cas.utils.ContentTypeHelper;
-
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MediaType;
 
 import static org.junit.Assert.assertEquals;
 
diff --git a/src/test/java/org/keycloak/protocol/cas/SamlResponseTest.java b/src/test/java/org/keycloak/protocol/cas/SamlResponseTest.java
index 0ac2c1c..e5b0c33 100644
--- a/src/test/java/org/keycloak/protocol/cas/SamlResponseTest.java
+++ b/src/test/java/org/keycloak/protocol/cas/SamlResponseTest.java
@@ -1,5 +1,6 @@
 package org.keycloak.protocol.cas;
 
+import jakarta.ws.rs.core.Response;
 import org.junit.Test;
 import org.keycloak.dom.saml.v1.protocol.SAML11ResponseType;
 import org.keycloak.protocol.cas.representations.CASErrorCode;
@@ -7,7 +8,6 @@
 import org.keycloak.protocol.cas.utils.CASValidationException;
 import org.w3c.dom.Document;
 
-import javax.ws.rs.core.Response;
 import java.util.Collections;
 
 import static org.junit.Assert.assertNotNull;
diff --git a/src/test/java/org/keycloak/protocol/cas/XMLValidator.java b/src/test/java/org/keycloak/protocol/cas/XMLValidator.java
index 2a85231..0893b67 100644
--- a/src/test/java/org/keycloak/protocol/cas/XMLValidator.java
+++ b/src/test/java/org/keycloak/protocol/cas/XMLValidator.java
@@ -1,6 +1,6 @@
 package org.keycloak.protocol.cas;
 
-import com.sun.xml.bind.v2.util.FatalAdapter;
+import org.glassfish.jaxb.runtime.v2.util.FatalAdapter;
 import org.w3c.dom.Document;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;

--
Gitblit v1.9.1