#include "Application.h"
#include "exceptions.h"
#include "ServiceProvider.h"
-#include "attribute/resolver/AttributeResolver.h"
-#include "attribute/resolver/ResolutionContext.h"
#include "handler/AssertionConsumerService.h"
-#include "security/SecurityPolicy.h"
#include "util/SPConstants.h"
-#include <saml/SAMLConfig.h>
-#include <saml/saml1/core/Assertions.h>
-#include <saml/util/CommonDomainCookie.h>
+# include <ctime>
+#ifndef SHIBSP_LITE
+# include "attribute/resolver/AttributeResolver.h"
+# include "attribute/resolver/ResolutionContext.h"
+# include "security/SecurityPolicy.h"
+# include <saml/SAMLConfig.h>
+# include <saml/saml1/core/Assertions.h>
+# include <saml/util/CommonDomainCookie.h>
+using namespace samlconstants;
+#else
+# include "lite/CommonDomainCookie.h"
+#endif
using namespace shibspconstants;
-using namespace samlconstants;
using namespace shibsp;
using namespace opensaml;
using namespace xmltooling;
using namespace std;
AssertionConsumerService::AssertionConsumerService(const DOMElement* e, const char* appId, Category& log)
- : AbstractHandler(e, log), m_decoder(NULL), m_configNS(SHIB2SPCONFIG_NS),
- m_role(samlconstants::SAML20MD_NS, opensaml::saml2md::IDPSSODescriptor::LOCAL_NAME)
+ : AbstractHandler(e, log)
+#ifndef SHIBSP_LITE
+ ,m_decoder(NULL), m_role(samlconstants::SAML20MD_NS, opensaml::saml2md::IDPSSODescriptor::LOCAL_NAME)
+#endif
{
string address(appId);
address += getString("Location").second;
- address += "::run::ACS";
setAddress(address.c_str());
+#ifndef SHIBSP_LITE
if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) {
m_decoder = SAMLConfig::getConfig().MessageDecoderManager.newPlugin(getString("Binding").second,e);
m_decoder->setArtifactResolver(SPConfig::getConfig().getArtifactResolver());
}
+#endif
}
AssertionConsumerService::~AssertionConsumerService()
{
+#ifndef SHIBSP_LITE
delete m_decoder;
+#endif
}
pair<bool,long> AssertionConsumerService::run(SPRequest& request, bool isHandler) const
DDF out,in = wrap(request);
DDFJanitor jin(in), jout(out);
- in.addmember("application_id").string(request.getApplication().getId());
try {
out=request.getServiceProvider().getListenerService()->send(in);
}
const Application& application, HTTPRequest& httpRequest, string& entityID, string& relayState
) const
{
+#ifndef SHIBSP_LITE
// Locate policy key.
pair<bool,const char*> policyId = getString("policyId", m_configNS.get()); // namespace-qualified if inside handler element
if (!policyId.first)
entityID = issuer.get();
return key;
+#else
+ throw ConfigurationException("Cannot process message using lite version of shibsp library.");
+#endif
}
pair<bool,long> AssertionConsumerService::sendRedirect(
}
}
+#ifndef SHIBSP_LITE
ResolutionContext* AssertionConsumerService::resolveAttributes(
const Application& application,
const saml2md::EntityDescriptor* issuer,
+ const XMLCh* protocol,
const saml2::NameID* nameid,
- const char* authncontext_class,
- const char* authncontext_decl,
+ const XMLCh* authncontext_class,
+ const XMLCh* authncontext_decl,
const vector<const Assertion*>* tokens,
const multimap<string,Attribute*>* attributes
) const
Locker locker(resolver);
auto_ptr<ResolutionContext> ctx(
- resolver->createResolutionContext(application, issuer, nameid, authncontext_class, authncontext_decl, tokens, attributes)
+ resolver->createResolutionContext(application, issuer, protocol, nameid, authncontext_class, authncontext_decl, tokens, attributes)
);
resolver->resolveAttributes(*ctx.get());
return ctx.release();
return NULL;
}
+#endif
void AssertionConsumerService::maintainHistory(SPRequest& request, const char* entityID, const char* cookieProps) const
{