From 7b839951b7d2cb088a557c642c2dec65bc5953ce Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <Jacek@jacekk.info>
Date: Tue, 03 Nov 2026 20:58:44 +0000
Subject: [PATCH] Bind service and proxy tickets to the service they were issued for

---
 integrationTest/suite.sh |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/integrationTest/suite.sh b/integrationTest/suite.sh
index d389f40..b2f2b24 100755
--- a/integrationTest/suite.sh
+++ b/integrationTest/suite.sh
@@ -41,6 +41,14 @@
 $CURL "${keycloak_cas_url}/validate?service=http://localhost&ticket=$ticket"
 echo
 
+echo "Testing CAS 1.0 - ticket issued for another service..."
+ticket=$(get_ticket)
+if $CURL "${keycloak_cas_url}/validate?service=http://localhost/other&ticket=$ticket"; then
+    echo "Ticket was accepted for a different service"
+    exit 1
+fi
+echo
+
 # CAS 2.0
 echo "Testing CAS 2.0 - XML..."
 ticket=$(get_ticket)
@@ -58,6 +66,20 @@
 $CURL "${keycloak_cas_url}/p3/serviceValidate?service=http://localhost&format=JSON&ticket=$ticket"
 echo
 
+# CAS 2.0 - proxy validation
+echo "Testing CAS 2.0 - proxyValidate..."
+ticket=$(get_ticket)
+$CURL "${keycloak_cas_url}/proxyValidate?service=http://localhost&format=JSON&ticket=$ticket"
+echo
+
+echo "Testing CAS 2.0 - proxyValidate without service..."
+ticket=$(get_ticket)
+if $CURL "${keycloak_cas_url}/proxyValidate?format=JSON&ticket=$ticket"; then
+    echo "Ticket was accepted without service parameter"
+    exit 1
+fi
+echo
+
 # SAML 1.1
 echo "Testing SAML 1.1..."
 ticket=$(get_ticket SAML)

--
Gitblit v1.10.0