From 2cb3703253b911cc9e72ed7926587e5e6e3ddd8f Mon Sep 17 00:00:00 2001 From: Ben Alex Date: Sat, 3 Jul 2004 00:47:46 +0000 Subject: [PATCH] Relax restriction on empty Strings for proxy callback URL, as this should be an empty String if no proxy callback was requested during service ticket validation. --- .../providers/cas/CasAuthenticationToken.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/org/acegisecurity/providers/cas/CasAuthenticationToken.java b/core/src/main/java/org/acegisecurity/providers/cas/CasAuthenticationToken.java index b1d30fcd38..6b9d91e4aa 100644 --- a/core/src/main/java/org/acegisecurity/providers/cas/CasAuthenticationToken.java +++ b/core/src/main/java/org/acegisecurity/providers/cas/CasAuthenticationToken.java @@ -55,7 +55,8 @@ public class CasAuthenticationToken extends AbstractAuthenticationToken * @param proxyList the list of proxies from CAS (cannot be * null) * @param proxyGrantingTicketIou the PGT-IOU ID from CAS (cannot be - * null) + * null, but may be an empty String if no + * PGT-IOU ID was provided) * * @throws IllegalArgumentException if a null was passed */ @@ -65,8 +66,7 @@ public class CasAuthenticationToken extends AbstractAuthenticationToken if ((key == null) || ("".equals(key)) || (principal == null) || "".equals(principal) || (credentials == null) || "".equals(credentials) || (authorities == null) - || (proxyList == null) || (proxyGrantingTicketIou == null) - || ("".equals(proxyGrantingTicketIou))) { + || (proxyList == null) || (proxyGrantingTicketIou == null)) { throw new IllegalArgumentException( "Cannot pass null or empty values to constructor"); } @@ -127,6 +127,12 @@ public class CasAuthenticationToken extends AbstractAuthenticationToken return this.principal; } + /** + * Obtains the proxy granting ticket IOU. + * + * @return the PGT IOU-ID or an empty String if no proxy + * callback was requested when validating the service ticket + */ public String getProxyGrantingTicketIou() { return proxyGrantingTicketIou; }