https://issues.shibboleth.net/jira/browse/SSPCPP-458
[shibboleth/cpp-sp.git] / shibsp / SessionCache.h
index b00d427..7b7a6d6 100644 (file)
@@ -34,6 +34,7 @@
 #include <string>
 #include <vector>
 #include <ctime>
+#include <xercesc/util/XercesDefs.hpp>
 #include <xmltooling/Lockable.h>
 
 namespace xmltooling {
@@ -48,6 +49,9 @@ namespace opensaml {
     namespace saml2 {
         class SAML_API NameID;
     };
+    namespace saml2md {
+        class SAML_API EntityDescriptor;
+    };
 };
 #endif
 
@@ -228,6 +232,7 @@ namespace shibsp {
 
 #ifndef SHIBSP_LITE
         /**
+         * @deprecated
          * Inserts a new session into the cache and binds the session to the outgoing
          * client response.
          *
@@ -264,6 +269,46 @@ namespace shibsp {
             )=0;
 
         /**
+         * Inserts a new session into the cache and binds the session to the outgoing
+         * client response.
+         *
+         * <p>The newly created session ID is placed into the first parameter.
+         *
+         * <p>The SSO tokens and Attributes remain owned by the caller and are copied by the cache.
+         *
+         * @param sessionID         reference to string to capture newly inserted session ID
+         * @param application       reference to Application that owns the Session
+         * @param httpRequest       request that initiated session
+         * @param httpResponse      current response to client
+         * @param expires           expiration time of session
+         * @param issuer            issuing metadata of assertion issuer, if known
+         * @param protocol          protocol family used to initiate the session
+         * @param nameid            principal identifier, normalized to SAML 2, if any
+         * @param authn_instant     UTC timestamp of authentication at IdP, if known
+         * @param session_index     index of session between principal and IdP, if any
+         * @param authncontext_class    method/category of authentication event, if known
+         * @param authncontext_decl specifics of authentication event, if known
+         * @param tokens            assertions to cache with session, if any
+         * @param attributes        optional array of resolved Attributes to cache with session
+         */
+        virtual void insert(
+            std::string& sessionID,
+            const Application& application,
+            const xmltooling::HTTPRequest& httpRequest,
+            xmltooling::HTTPResponse& httpResponse,
+            time_t expires,
+            const opensaml::saml2md::EntityDescriptor* issuer=nullptr,
+            const XMLCh* protocol=nullptr,
+            const opensaml::saml2::NameID* nameid=nullptr,
+            const XMLCh* authn_instant=nullptr,
+            const XMLCh* session_index=nullptr,
+            const XMLCh* authncontext_class=nullptr,
+            const XMLCh* authncontext_decl=nullptr,
+            const std::vector<const opensaml::Assertion*>* tokens=nullptr,
+            const std::vector<Attribute*>* attributes=nullptr
+            );
+
+        /**
          * Determines whether the Session bound to a client request matches a set of input criteria.
          *
          * @param application   reference to Application that owns the Session