diff --git a/cas-client-core/pom.xml b/cas-client-core/pom.xml index 4830765..9f7923a 100644 --- a/cas-client-core/pom.xml +++ b/cas-client-core/pom.xml @@ -2,7 +2,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> org.jasig.cas - 3.1.9-SNAPSHOT + 3.1.9 cas-client 4.0.0 diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/session/SingleSignOutFilter.java b/cas-client-core/src/main/java/org/jasig/cas/client/session/SingleSignOutFilter.java index 5c6cf7c..9e5d53a 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/session/SingleSignOutFilter.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/session/SingleSignOutFilter.java @@ -88,18 +88,22 @@ public final class SingleSignOutFilter extends AbstractConfigurationFilter { } } else { final String artifact = CommonUtils.safeGetParameter(request, this.artifactParameterName); - final HttpSession session = request.getSession(); - - if (log.isDebugEnabled() && session != null) { - log.debug("Storing session identifier for " + session.getId()); - } - if (CommonUtils.isNotBlank(artifact)) { - try { - SESSION_MAPPING_STORAGE.removeBySessionById(session.getId()); - } catch (final Exception e) { - // ignore if the session is already marked as invalid. Nothing we can do! - } - SESSION_MAPPING_STORAGE.addSessionById(artifact, session); + final HttpSession session = request.getSession(false); + + if (session != null) { + if (log.isDebugEnabled()) { + log.debug("Storing session identifier for " + session.getId()); + } + if (CommonUtils.isNotBlank(artifact)) { + try { + SESSION_MAPPING_STORAGE.removeBySessionById(session.getId()); + } catch (final Exception e) { + // ignore if the session is already marked as invalid. Nothing we can do! + } + SESSION_MAPPING_STORAGE.addSessionById(artifact, session); + } + } else { + log.debug("No Session Found, so ignoring."); } } diff --git a/cas-client-integration-atlassian/pom.xml b/cas-client-integration-atlassian/pom.xml index ff1421c..a47baf8 100644 --- a/cas-client-integration-atlassian/pom.xml +++ b/cas-client-integration-atlassian/pom.xml @@ -2,7 +2,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> org.jasig.cas - 3.1.9-SNAPSHOT + 3.1.9 cas-client 4.0.0 diff --git a/cas-client-support-distributed-ehcache/pom.xml b/cas-client-support-distributed-ehcache/pom.xml new file mode 100644 index 0000000..f0e6db8 --- /dev/null +++ b/cas-client-support-distributed-ehcache/pom.xml @@ -0,0 +1,37 @@ + + + + cas-client + org.jasig.cas + 3.1.9 + + 4.0.0 + + org.jasig.cas + cas-client-support-distributed + jar + + + + org.jasig.cas + + cas-client-core + ${project.version} + jar + compile + + + + + net.sf.ehcache + ehcache + ${ehcache.version} + compile + jar + + + + + \ No newline at end of file diff --git a/cas-client-support-distributed-ehcache/src/main/java/org/jasig/cas/client/proxy/EhcacheBackedProxyGrantingTicketStorageImpl.java b/cas-client-support-distributed-ehcache/src/main/java/org/jasig/cas/client/proxy/EhcacheBackedProxyGrantingTicketStorageImpl.java new file mode 100644 index 0000000..6adc62d --- /dev/null +++ b/cas-client-support-distributed-ehcache/src/main/java/org/jasig/cas/client/proxy/EhcacheBackedProxyGrantingTicketStorageImpl.java @@ -0,0 +1,50 @@ +/* + * Copyright 2007 The JA-SIG Collaborative. All rights reserved. See license + * distributed with this file and available online at + * http://www.ja-sig.org/products/cas/overview/license/index.html + */ +package org.jasig.cas.client.proxy; + +import net.sf.ehcache.Cache; +import net.sf.ehcache.Element; +import net.sf.ehcache.CacheManager; + +/** + * @author Scott Battaglia + * @version $Revision$ $Date$ + * @since 3.1.9 + */ +public final class EhcacheBackedProxyGrantingTicketStorageImpl implements ProxyGrantingTicketStorage { + + public static final String EHCACHE_CACHE_NAME = "org.jasig.cas.client.proxy.EhcacheBackedProxyGrantingTicketStorageImpl.cache"; + + final Cache cache; + + public EhcacheBackedProxyGrantingTicketStorageImpl() { + this(CacheManager.create().getCache(EHCACHE_CACHE_NAME)); + + } + + public EhcacheBackedProxyGrantingTicketStorageImpl(final Cache cache) { + this.cache = cache; + } + + public void save(final String proxyGrantingTicketIou, final String proxyGrantingTicket) { + final Element element = new Element(proxyGrantingTicketIou, proxyGrantingTicket); + this.cache.put(element); + } + + public String retrieve(final String proxyGrantingTicketIou) { + final Element element = this.cache.get(proxyGrantingTicketIou); + + if (element == null) { + return null; + } + + return (String) element.getValue(); + } + + public void cleanUp() { + return; + } +} diff --git a/cas-client-support-distributed-memcached/pom.xml b/cas-client-support-distributed-memcached/pom.xml index f68acc5..d43cf7a 100644 --- a/cas-client-support-distributed-memcached/pom.xml +++ b/cas-client-support-distributed-memcached/pom.xml @@ -5,7 +5,7 @@ cas-client org.jasig.cas - 3.1.9-SNAPSHOT + 3.1.9 4.0.0 @@ -45,7 +45,7 @@ org.apache.maven.plugins - maven-compiler-plugin + maven-compiler-plugin 1.5 1.5 diff --git a/pom.xml b/pom.xml index 8fe880a..29197e1 100644 --- a/pom.xml +++ b/pom.xml @@ -1,7 +1,7 @@ 4.0.0 org.jasig.cas - 3.1.9-SNAPSHOT + 3.1.9 cas-client pom JA-SIG CAS Client for Java @@ -144,4 +144,4 @@ sftp://web.sourceforge.net/home/groups/a/ac/acegisecurity/htdocs/repository/releases - \ No newline at end of file +