First set of logout base classes and non-building draft of SP-initiated logout.
[shibboleth/sp.git] / shibsp / handler / AssertionConsumerService.h
index 5466012..df28122 100644 (file)
 
 #include <shibsp/handler/AbstractHandler.h>
 #include <shibsp/handler/RemotedHandler.h>
-#include <saml/binding/MessageDecoder.h>
-#include <saml/saml2/metadata/Metadata.h>
+#ifndef SHIBSP_LITE
+# include <saml/binding/MessageDecoder.h>
+# include <saml/saml2/metadata/Metadata.h>
+#endif
+#include <xmltooling/unicode.h>
 
 namespace shibsp {
 
+    class SHIBSP_API Attribute;
     class SHIBSP_API ResolutionContext;
 
 #if defined (_MSC_VER)
@@ -49,8 +53,16 @@ namespace shibsp {
         void receive(DDF& in, std::ostream& out);
 
     protected:
-        AssertionConsumerService(const DOMElement* e, log4cpp::Category& log);
+        /**
+         * Constructor
+         * 
+         * @param e     root of DOM configuration
+         * @param appId ID of application that "owns" the handler
+         * @param log   a logging object to use
+         */
+        AssertionConsumerService(const xercesc::DOMElement* e, const char* appId, log4cpp::Category& log);
         
+#ifndef SHIBSP_LITE
         /**
          * Implement protocol-specific handling of the incoming decoded message.
          * 
@@ -66,59 +78,67 @@ namespace shibsp {
          */
         virtual std::string implementProtocol(
             const Application& application,
-            const opensaml::HTTPRequest& httpRequest,
+            const xmltooling::HTTPRequest& httpRequest,
             opensaml::SecurityPolicy& policy,
             const PropertySet* settings,
             const xmltooling::XMLObject& xmlObject
             ) const=0;
-            
-        /**
-         * Enforce address checking requirements.
-         * 
-         * @param application   reference to application receiving message
-         * @param httpRequest   client request that initiated session
-         * @param issuedTo      address for which security assertion was issued
-         */
-        void checkAddress(
-            const Application& application, const opensaml::HTTPRequest& httpRequest, const char* issuedTo
-            ) const;
-        
+
         /**
          * Attempt SSO-initiated attribute resolution using the supplied information.
          * 
          * <p>The caller must free the returned context handle.
          * 
          * @param application   reference to application receiving message
-         * @param httpRequest   client request that initiated session
          * @param issuer        source of SSO tokens
+         * @param protocol      SSO protocol used
          * @param nameid        identifier of principal
-         * @param tokens        tokens to resolve, if any
+         * @param authncontext_class    method/category of authentication event, if known
+         * @param authncontext_decl specifics of authentication event, if known
+         * @param tokens        available assertions, if any
+         * @param attributes    attributes already extracted, if any
          */
         ResolutionContext* resolveAttributes(
             const Application& application,
-            const opensaml::HTTPRequest& httpRequest,
-            const opensaml::saml2md::EntityDescriptor* issuer,
-            const opensaml::saml2::NameID& nameid,
-            const std::vector<const opensaml::Assertion*>* tokens=NULL
+            const opensaml::saml2md::EntityDescriptor* issuer=NULL,
+            const XMLCh* protocol=NULL,
+            const opensaml::saml2::NameID* nameid=NULL,
+            const XMLCh* authncontext_class=NULL,
+            const XMLCh* authncontext_decl=NULL,
+            const std::vector<const opensaml::Assertion*>* tokens=NULL,
+            const std::multimap<std::string,Attribute*>* attributes=NULL
+            ) const;
+#endif
+        
+        /**
+         * Enforce address checking requirements.
+         * 
+         * @param application   reference to application receiving message
+         * @param httpRequest   client request that initiated session
+         * @param issuedTo      address for which security assertion was issued
+         */
+        void checkAddress(
+            const Application& application, const xmltooling::HTTPRequest& httpRequest, const char* issuedTo
             ) const;
         
     private:
         std::string processMessage(
             const Application& application,
-            const opensaml::HTTPRequest& httpRequest,
-            std::string& providerId,
+            xmltooling::HTTPRequest& httpRequest,
+            std::string& entityID,
             std::string& relayState
             ) const;
             
         std::pair<bool,long> sendRedirect(
-            SPRequest& request, const char* key, const char* providerId, const char* relayState
+            SPRequest& request, const char* key, const char* entityID, const char* relayState
             ) const;
         
-        void maintainHistory(SPRequest& request, const char* providerId, const char* cookieProps) const;
+        void maintainHistory(SPRequest& request, const char* entityID, const char* cookieProps) const;
                 
+#ifndef SHIBSP_LITE
         opensaml::MessageDecoder* m_decoder;
-        xmltooling::auto_ptr_char m_configNS;
         xmltooling::QName m_role;
+#endif
     };
 
 #if defined (_MSC_VER)