Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
GRANDGERARD Gilles
keycloak-protocol-cas
Commits
1293d518
Commit
1293d518
authored
Jan 22, 2018
by
Matthias Piepkorn
Browse files
remove dependency on internal SAML packages
parent
87365285
Changes
2
Hide whitespace changes
Inline
Side-by-side
pom.xml
View file @
1293d518
...
@@ -85,7 +85,7 @@
...
@@ -85,7 +85,7 @@
<groupId>
org.keycloak
</groupId>
<groupId>
org.keycloak
</groupId>
<artifactId>
keycloak-saml-core
</artifactId>
<artifactId>
keycloak-saml-core
</artifactId>
<version>
${keycloak.version}
</version>
<version>
${keycloak.version}
</version>
<scope>
provided
</scope>
<scope>
test
</scope>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
junit
</groupId>
<groupId>
junit
</groupId>
...
@@ -126,7 +126,7 @@
...
@@ -126,7 +126,7 @@
<configuration>
<configuration>
<archive>
<archive>
<manifestEntries>
<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>
</manifestEntries>
</archive>
</archive>
</configuration>
</configuration>
...
...
src/main/java/org/keycloak/protocol/cas/utils/LogoutHelper.java
View file @
1293d518
...
@@ -8,15 +8,14 @@ import org.apache.http.entity.ContentType;
...
@@ -8,15 +8,14 @@ import org.apache.http.entity.ContentType;
import
org.apache.http.entity.StringEntity
;
import
org.apache.http.entity.StringEntity
;
import
org.keycloak.connections.httpclient.HttpClientProvider
;
import
org.keycloak.connections.httpclient.HttpClientProvider
;
import
org.keycloak.models.KeycloakSession
;
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.ws.rs.core.HttpHeaders
;
import
javax.xml.datatype.XMLGregorianCalendar
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.charset.StandardCharsets
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.UUID
;
public
class
LogoutHelper
{
public
class
LogoutHelper
{
//although it looks alike, the CAS SLO protocol has nothing to do with SAML; so we build the format
//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 {
...
@@ -27,14 +26,9 @@ public class LogoutHelper {
"</samlp:LogoutRequest>"
;
"</samlp:LogoutRequest>"
;
public
static
HttpEntity
buildSingleLogoutRequest
(
String
serviceTicket
)
{
public
static
HttpEntity
buildSingleLogoutRequest
(
String
serviceTicket
)
{
String
id
=
IDGenerator
.
create
(
"ID_"
);
String
id
=
"ID_"
+
UUID
.
randomUUID
().
toString
();
XMLGregorianCalendar
issueInstant
;
String
issueInstant
=
new
SimpleDateFormat
(
"yyyy-MM-dd'T'H:mm:ss"
).
format
(
new
Date
());
try
{
String
document
=
TEMPLATE
.
replace
(
"$ID"
,
id
).
replace
(
"$ISSUE_INSTANT"
,
issueInstant
)
issueInstant
=
XMLTimeUtil
.
getIssueInstant
();
}
catch
(
ConfigurationException
e
)
{
throw
new
RuntimeException
(
e
);
}
String
document
=
TEMPLATE
.
replace
(
"$ID"
,
id
).
replace
(
"$ISSUE_INSTANT"
,
issueInstant
.
toString
())
.
replace
(
"$SESSION_IDENTIFIER"
,
serviceTicket
);
.
replace
(
"$SESSION_IDENTIFIER"
,
serviceTicket
);
return
new
StringEntity
(
document
,
ContentType
.
APPLICATION_XML
.
withCharset
(
StandardCharsets
.
UTF_8
));
return
new
StringEntity
(
document
,
ContentType
.
APPLICATION_XML
.
withCharset
(
StandardCharsets
.
UTF_8
));
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment