[cpp-sp] branch master updated: Differentiate session retrieval error messages.

Scott Cantor cantor.2 at osu.edu
Mon Apr 23 22:32:13 EDT 2018


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch master
in repository cpp-sp.

View the commit online:
http://git.shibboleth.net/view/?p=cpp-sp.git;a=commit;h=630e51defbb1693c5db19cbdc9100577bd9e8dac

The following commit(s) were added to refs/heads/master by this push:
       new  630e51d   Differentiate session retrieval error messages.
630e51d is described below

commit 630e51defbb1693c5db19cbdc9100577bd9e8dac
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon Apr 23 22:32:07 2018 -0400

    Differentiate session retrieval error messages.
---
 shibsp/impl/StorageServiceSessionCache.cpp | 15 ++++++++-------
 shibsp/impl/StoredSession.cpp              |  6 +++---
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/shibsp/impl/StorageServiceSessionCache.cpp b/shibsp/impl/StorageServiceSessionCache.cpp
index 84af747..bda1f1b 100644
--- a/shibsp/impl/StorageServiceSessionCache.cpp
+++ b/shibsp/impl/StorageServiceSessionCache.cpp
@@ -953,7 +953,7 @@ Session* SSCache::_find(const Application& app, const char* key, const char* rec
 
             if (0 == lastAccess) {
                 m_log.error("session (ID: %s) did not report time of last access", key);
-                throw RetryableProfileException("Your session has expired, and you must re-authenticate.");
+                throw RetryableProfileException("Your session's last access time was missing, and you must re-authenticate.");
             }
 
             m_log.debug("reconstituting session and checking validity");
@@ -981,7 +981,8 @@ Session* SSCache::_find(const Application& app, const char* key, const char* rec
                 }
                 string eid2(eid);
                 obj.destroy();
-                throw RetryableProfileException("Your session has expired, and you must re-authenticate.", namedparams(1, "entityID", eid2.c_str()));
+                throw RetryableProfileException("Your session has timed out due to inactivity, and you must re-authenticate.",
+                    namedparams(1, "entityID", eid2.c_str()));
             }
 
             if (timeout) {
@@ -1412,7 +1413,7 @@ void SSCache::receive(DDF& in, ostream& out)
         
         if (lastAccess == 0) {
             m_log.error("session (ID: %s) did not report time of last access", key);
-            throw RetryableProfileException("Your session has expired, and you must re-authenticate.");
+            throw RetryableProfileException("Your session's last access time was missing, and you must re-authenticate.");
         }
 
         // Adjust for expiration to recover last access time and check timeout.
@@ -1437,7 +1438,7 @@ void SSCache::receive(DDF& in, ostream& out)
                     app->getServiceProvider().getTransactionLog()->write(*logout_event);
                 }
                 remove(*app, key);
-                throw RetryableProfileException("Your session has expired, and you must re-authenticate.");
+                throw RetryableProfileException("Your session has timed out due to inactivity, and you must re-authenticate.");
             }
 
             // Update storage expiration, if possible.
@@ -1465,11 +1466,11 @@ void SSCache::receive(DDF& in, ostream& out)
         int ver = m_storage->readText(key, "session", &record, &lastAccess, client_addr ? 0 : curver);
         if (ver == 0) {
             m_log.info("session (ID: %s) no longer in storage", key);
-            throw RetryableProfileException("Your session has expired, and you must re-authenticate.");
+            throw RetryableProfileException("Your session is not available in the session store, and you must re-authenticate.");
         }
         else if (lastAccess == 0) {
             m_log.error("session (ID: %s) did not report time of last access", key);
-            throw RetryableProfileException("Your session has expired, and you must re-authenticate.");
+            throw RetryableProfileException("Your session's last access time was missing, and you must re-authenticate.");
         }
 
         // Adjust for expiration to recover last access time and check timeout.
@@ -1488,7 +1489,7 @@ void SSCache::receive(DDF& in, ostream& out)
 
         if (timeout > 0 && now - lastAccess >= timeout) {
             m_log.info("session timed out (ID: %s)", key);
-            throw RetryableProfileException("Your session has expired, and you must re-authenticate.");
+            throw RetryableProfileException("Your session has timed out due to inactivity, and you must re-authenticate.");
         }
 
         // Update storage expiration, if possible.
diff --git a/shibsp/impl/StoredSession.cpp b/shibsp/impl/StoredSession.cpp
index d7d9379..4b7873d 100644
--- a/shibsp/impl/StoredSession.cpp
+++ b/shibsp/impl/StoredSession.cpp
@@ -252,20 +252,20 @@ void StoredSession::validate(const Application& app, const char* client_addr, ti
         int ver = m_cache->m_storage->readText(getID(), "session", &record, &lastAccess, curver);
         if (ver == 0) {
             m_cache->m_log.info("session (ID: %s) no longer in storage", getID());
-            throw RetryableProfileException("Your session has expired, and you must re-authenticate.");
+            throw RetryableProfileException("Your session is not available in the session store, and you must re-authenticate.");
         }
 
         if (timeout) {
             if (lastAccess == 0) {
                 m_cache->m_log.error("session (ID: %s) did not report time of last access", getID());
-                throw RetryableProfileException("Your session has expired, and you must re-authenticate.");
+                throw RetryableProfileException("Your session's last access time was missing, and you must re-authenticate.");
             }
             // Adjust for expiration to recover last access time and check timeout.
             unsigned long cacheTimeout = m_cache->getCacheTimeout(app);
             lastAccess -= cacheTimeout;
             if (*timeout > 0 && now - lastAccess >= *timeout) {
                 m_cache->m_log.info("session timed out (ID: %s)", getID());
-                throw RetryableProfileException("Your session has expired, and you must re-authenticate.");
+                throw RetryableProfileException("Your session has timed out due to inactivity, and you must re-authenticate.");
             }
 
             // Update storage expiration, if possible.

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list