Commit 1293d518 authored by Matthias Piepkorn's avatar Matthias Piepkorn

remove dependency on internal SAML packages

parent 87365285
......@@ -85,7 +85,7 @@
<groupId>org.keycloak</groupId>
<artifactId>keycloak-saml-core</artifactId>
<version>${keycloak.version}</version>
<scope>provided</scope>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
......@@ -126,7 +126,7 @@
<configuration>
<archive>
<manifestEntries>
<Dependencies>javax.xml.bind.api,org.keycloak.keycloak-core,org.keycloak.keycloak-server-spi,org.keycloak.keycloak-server-spi-private,org.keycloak.keycloak-services,org.keycloak.keycloak-saml-core,org.keycloak.keycloak-saml-core-public</Dependencies>
<Dependencies>javax.xml.bind.api,org.keycloak.keycloak-core,org.keycloak.keycloak-server-spi,org.keycloak.keycloak-server-spi-private,org.keycloak.keycloak-services</Dependencies>
</manifestEntries>
</archive>
</configuration>
......
......@@ -8,15 +8,14 @@ import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.keycloak.connections.httpclient.HttpClientProvider;
import org.keycloak.models.KeycloakSession;
import org.keycloak.saml.common.exceptions.ConfigurationException;
import org.keycloak.saml.processing.core.saml.v2.common.IDGenerator;
import org.keycloak.saml.processing.core.saml.v2.util.XMLTimeUtil;
import javax.ws.rs.core.HttpHeaders;
import javax.xml.datatype.XMLGregorianCalendar;
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;
public class LogoutHelper {
//although it looks alike, the CAS SLO protocol has nothing to do with SAML; so we build the format
......@@ -27,14 +26,9 @@ public class LogoutHelper {
"</samlp:LogoutRequest>";
public static HttpEntity buildSingleLogoutRequest(String serviceTicket) {
String id = IDGenerator.create("ID_");
XMLGregorianCalendar issueInstant;
try {
issueInstant = XMLTimeUtil.getIssueInstant();
} catch (ConfigurationException e) {
throw new RuntimeException(e);
}
String document = TEMPLATE.replace("$ID", id).replace("$ISSUE_INSTANT", issueInstant.toString())
String id = "ID_" + UUID.randomUUID().toString();
String issueInstant = new SimpleDateFormat("yyyy-MM-dd'T'H:mm:ss").format(new Date());
String document = TEMPLATE.replace("$ID", id).replace("$ISSUE_INSTANT", issueInstant)
.replace("$SESSION_IDENTIFIER", serviceTicket);
return new StringEntity(document, ContentType.APPLICATION_XML.withCharset(StandardCharsets.UTF_8));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment